home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / ien / ien-186 < prev    next >
Text File  |  1988-12-01  |  153KB  |  4,040 lines

  1.  
  2.      IEN 186                                               1 June 1981
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                       PROPOSED DCEC IP SPECIFICATION
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                    prepared by
  17.  
  18.                 Mary M. Bernstein
  19.  
  20.                       System Development Corporation
  21.                            2500 Colorado Avenue
  22.                           Santa Monica, CA 90406
  23.                               (213) 820-4111
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.                                  Abstract
  37.  
  38.      This document specifies the Internet Protocol (IP) which supports
  39.      the  interconnection  of communication subnetworks.  The document
  40.      includes an introducion to IP with a model of operation, a defin-
  41.      ition  of services provided to users, and a description architec-
  42.      tural  and  environmental  requirements.   The  protocol  service
  43.      interfaces  and  mechanisms are specified using an abstract state
  44.      machine model.
  45.  
  46.  
  47.  
  48.                                         System Development Corporation
  49.      1 June 1981                                               IEN 186
  50.  
  51.  
  52.      FOREWORD
  53.  
  54.  
  55.  
  56.  
  57.  
  58.      This document has been submitted to the DCEC for consideration as
  59.      a  standard specification of the Internet Protocol.  The document
  60.      incorporates  the  organization  and   specification   techniques
  61.      presented in the DCEC Protocol Specification Guidelines.  This is
  62.      a preliminary version; a revised version is  to  be  released  in
  63.      December  1981.   Any  comments  regarding  completeness and con-
  64.      sistency or suggestions for improvement of this document are wel-
  65.      comed.
  66.  
  67.  
  68.                                    Mary M. Bernstein
  69.  
  70.                                    System Development Corporation
  71.                                    2500 Colorado Avenue
  72.                                    Santa Monica, CA 90406
  73.                                    (213) 820-4111
  74.  
  75.                    ARPANET: brnstein@dti
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.                                  CONTENTS
  84.  
  85.  
  86.      1.  OVERVIEW.................................................   1
  87.          1.1  Scenario............................................   4
  88.  
  89.      2.  DESCRIPTION OF SERVICES PROVIDED TO UPPER LAYERS.........   6
  90.          2.1  Datagram Service....................................   6
  91.          2.2  Virtual Network Services............................   6
  92.          2.3  Error Reporting Service.............................   7
  93.  
  94.      3.  UPPER LAYER SERVICE/INTERFACE SPECIFICATION..............   8
  95.          3.1  Interaction Primitives..............................   8
  96.               3.1.1   Service Request Primitives   8
  97.               3.1.2   Service Response Primitives   9
  98.          3.2  Abstract Machine Definition of Upper Level Services
  99.               and Interaction Discipline..........................  10
  100.               3.2.1   Machine Identifier  10
  101.               3.2.2   State Diagram  11
  102.               3.2.3   State Vector  11
  103.               3.2.4   State Machine Data Structures  11
  104.               3.2.5   Event List  12
  105.               3.2.6   Events and Actions  12
  106.  
  107.      4.  DESCRIPTION OF LOWER LAYER SERVICE REQUIREMENTS..........  14
  108.          4.1  Data Transfer.......................................  14
  109.          4.2  Error Reporting.....................................  14
  110.  
  111.      5.  LOWER LAYER SERVICE/INTERFACE SPECIFICATION..............  15
  112.          5.1  Interaction Primitives..............................  15
  113.               5.1.1   Service Request Primitives  15
  114.               5.1.2   Service Response Primitives  16
  115.          5.2  Abstract Machine Definition of Lower Level Services
  116.               and Interaction Discipline..........................  16
  117.               5.2.1   Machine Identifier  16
  118.               5.2.2   State Diagram  17
  119.               5.2.3   State Vector  17
  120.               5.2.4   State Machine Data Structures  17
  121.               5.2.5   Event List  17
  122.               5.2.6   Events and Actions  18
  123.  
  124.      6.  MECHANISM SPECIFICATION..................................  19
  125.          6.1  Overview of IP Mechanisms...........................  19
  126.               6.1.1   Routing Mechanism  19
  127.               6.1.2   Fragmentation and Reassembly  21
  128.               6.1.3   Checksum  22
  129.               6.1.4   Time To Live  23
  130.               6.1.5   Type of Service  23
  131.               6.1.6   Data Options  23
  132.               6.1.7   Error Report Datagrams  24
  133.          6.2  Internet Protocol Header Format.....................  26
  134.               6.2.1   Version  26
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.               6.2.2   Internet Header Length  26
  143.               6.2.3   Type of Service  27
  144.               6.2.4   Total Length  27
  145.               6.2.5   Identification  27
  146.               6.2.6   Flags  28
  147.               6.2.7   Fragment Offset  28
  148.               6.2.8   Time to Live  28
  149.               6.2.9   Protocol  28
  150.               6.2.10  Header Checksum  29
  151.               6.2.11  Source Address  29
  152.               6.2.12  Destination Address  29
  153.               6.2.13  Padding  29
  154.               6.2.14  Options  29
  155.               6.2.15  Specific Option Definitions  31
  156.               6.2.16  Error Report Datagrams  33
  157.          6.3  Extended State Machine Representation...............  35
  158.               6.3.1   State Machine Identification  35
  159.               6.3.2   State Machine Diagram  35
  160.               6.3.3   State Vector  36
  161.               6.3.4   State Machine Data Structures  37
  162.               6.3.5   Event List  39
  163.               6.3.6   State Machine Events and Actions  39
  164.  
  165.      7.  EXECUTION ENVIRONMENT REQUIREMENTS.......................  72
  166.          7.1  Inter-process communication.........................  72
  167.          7.2  Timing..............................................  72
  168.  
  169.      8.  BIBLIOGRAPHY.............................................  73
  170.  
  171.      9.  GLOSSARY.................................................  74
  172.  
  173.  
  174.  
  175.                                         System Development Corporation
  176.      1 June 1981                    -1-                        IEN 186
  177.  
  178.  
  179.      1.  OVERVIEW
  180.  
  181.      This document specifies the Internet Protocol (IP) which supports
  182.      the  interconnection  of communication subnetworks.  The document
  183.      introduces the Internet Protocol's role and purpose, defines  the
  184.      services  provided  to users, and specifies the mechanisms needed
  185.      to support those services.  This document also defines  the  ser-
  186.      vices  required  of the lower protocol layer, describes the upper
  187.      and lower interfaces, and outlines the  operating  system  primi-
  188.      tives  needed  for  implementation.   In  addition, a glossary of
  189.      terms and a set of appendices discussing certain  aspects  of  IP
  190.      are included.  The reader is assumed to be familiar with the DCEC
  191.      Architecture Report which presents a protocol architecture  model
  192.      for  DoD  communication  services[1].  This document incorporates
  193.      the organization and specification techniques  presented  in  the
  194.      DCEC Protocol Specification Guidelines[2].
  195.  
  196.      The Internet Protocol is designed to interconnect packet-switched
  197.      communication  subnetworks to form an internetwork.  IP transmits
  198.      blocks of data, called internet datagrams, from sources to desti-
  199.      nations  throughout  the  internet.  Sources and destinations are
  200.      hosts located on either the same subnetwork or connected  subnet-
  201.      works.   IP  is  purposely  limited in scope to provide the basic
  202.      functions necessary to deliver a block of  data.   Each  internet
  203.      datagram is an independent entity unrelated to any other internet
  204.      datagram.  IP does not create connections  or  logical  circuits.
  205.      IP  has  no mechanisms to promote data reliability, flow control,
  206.      sequencing, or other services commonly found in host-to-host pro-
  207.      tocols.
  208.  
  209.  
  210.                 +------+ +-----+ +------+        +-----+
  211.                 |Telnet| | FTP | | EFTP |  ...   |     |
  212.                 +------+ +-----+ +------+        +-----+
  213.                       |   |         |               |
  214.                      +-----+     +-----+         +-----+
  215.                      | TCP |     | UDP |   ...   |     |
  216.                      +-----+     +-----+         +-----+
  217.                         |           |               |
  218.                      +--------------------------------+
  219.                      |     HOST INTERNET PROTOCOL     |
  220.                      +--------------------------------+
  221.                                     |
  222.                         +------------------------+
  223.                         |  Subnetwork Protocol   |
  224.                         +------------------------+
  225.  
  226.                    1. Example Host Protocol Hierarchy
  227.  
  228.  
  229.      This document specifies a host  IP.   In  the  DoD  architectural
  230.      model,  a  host  IP resides between transport layer and the lower
  231.  
  232.  
  233.  
  234.                                         System Development Corporation
  235.      1 June 1981                    -2-                        IEN 186
  236.  
  237.  
  238.      network sublayer in each internet host.  In each gateway, a  site
  239.      interconnecting  two  or more subnets, an IP resides above two or
  240.      more subnetwork entities.  In a gateway, IP is closely coupled to
  241.      the  Gateway  to  Gateway Protocol (GGP) to form a gateway IP.  A
  242.      gateway IP supports many of the same functions as a host IP,  but
  243.      provides  additional  services  such  as  maintenance  of current
  244.      internet topology data.  Throughout the remainder  of  the  docu-
  245.      ment, a host IP is simply referred to as IP.
  246.  
  247.                          GATEWAY INTERNET PROTOCOL
  248.                   +-----------------------------------+
  249.                   |      Gateway-Gateway Protocol     |
  250.                   +- - - - - - - - - - - - - - - - - -+
  251.                   |         Internet Protocol         |
  252.                   +-----------------------------------+
  253.                      |            |                |
  254.                +---------+   +---------+        +---------+
  255.                |subnet 1 |   |subnet 2 |  ...   |subnet i |
  256.                | protocol|   | protocol|        | protocol|
  257.                +---------+   +---------+        +---------+
  258.                     |            |                 |
  259.                  ARPANET      local net          public net
  260.  
  261.  
  262.                   2. Example Gateway Protocol Hierarchy
  263.  
  264.  
  265.      A protocol in an upper layer passes data to IP for delivery.   IP
  266.      packages  the  data  as an internet datagram and passes it to the
  267.      local subnetwork protocol for transmission across the local  sub-
  268.      net.   If  the  destination host is on the local subnet, IP sends
  269.      the datagram through the subnet directly to that  host.   If  the
  270.      destination  host is on a connected subnet, IP sends the datagram
  271.      to an appropriate gateway.   The  gateway,  in  turn,  sends  the
  272.      datagram  through  the next subnet to the destination host, or to
  273.      another gateway.
  274.  
  275.      Thus, datagrams move from one IP module  to  another  through  an
  276.      interconnected  set  of  subnetworks  until  the  destination  is
  277.      reached.  The sequence of IP modules  handling  the  datagram  in
  278.      transit  is  called  the gateway route. The gateway route is dis-
  279.      tinct from the lower level node-to-node route supplied by a  par-
  280.      ticular  subnetwork.   The gateway route is based on the destina-
  281.      tion internet address.  The IP modules  share  common  rules  for
  282.      interpreting internet addresses to perform internet routing.
  283.  
  284.      In transit, datagrams may traverse  a  subnetwork  whose  maximum
  285.      packet  size is smaller than the size of the datagram.  To handle
  286.      this, IP provides fragmentation and reassembly  mechanisms.   The
  287.      gateway  at  the  smaller-packet  subnet  fragments  the original
  288.      datagram into pieces, called datagram fragments, small enough for
  289.      transmission.   The IP module in the destination host reassembles
  290.  
  291.  
  292.  
  293.                                         System Development Corporation
  294.      1 June 1981                    -3-                        IEN 186
  295.  
  296.  
  297.      the datagram fragments to reproduce the original datagram.
  298.  
  299.      IP can support a diverse set of upper layer protocols (ULPs).   A
  300.      transport  protocol with real-time requirements, such as the Net-
  301.      work Voice Protocol (NVP), can make use of IP's datagram  service
  302.      directly.    A  transport  protocol  providing  ordered  reliable
  303.      delivery, such as TCP, can build additional mechanisms on top  of
  304.      IP's  basic datagram service.  Also, IP's delivery service can be
  305.      customized in some ways to suit the special  needs  of  an  upper
  306.      layer protocol.  For example, a pre-defined gateway route, called
  307.      a source route, can be supplied for an individual datagram.  Each
  308.      IP  module  forwards  the  datagram according to the source route
  309.      instead of using only the independent routing mechanism.
  310.  
  311.      The Internet Protocol shares a common history with the  Transmis-
  312.      sion Control Protocol, first described in [3].  Later, IP and TCP
  313.      were separated and specified as two distinct protocols in [4] and
  314.      [5].   A  wide  range  of  technical, legal, and political issues
  315.      associated with subnetwork interconnection is presented  in  [6].
  316.      Alternative  approaches  to  internetting,  including  the  CCITT
  317.      Recommendation X.75 and the PUP architecture, are introduced  and
  318.      compared  in in [7], [8], and [9].  Certain aspects of fragmenta-
  319.      tion and routing are are discussed in [10], and [11].   [12]  and
  320.      [13]  contain  current address mappings and assigned numbers used
  321.      in network protocol implementations.
  322.  
  323.  
  324.  
  325.                                         System Development Corporation
  326.      1 June 1981                    -4-                        IEN 186
  327.  
  328.  
  329.      1.1  Scenario
  330.  
  331.      The following scenario illustrates the  model  of  operation  for
  332.      transmitting a datagram from one upper layer protocol to another.
  333.      The scenario is purposely simple so that IP's basic operation  is
  334.      not  obscured  by  the  details of interface parameters or header
  335.      fields.
  336.  
  337.      A ULP in host A is to send data to a peer protocol in host  B  on
  338.      another  subnetwork.   In  this  case, the source and destination
  339.      hosts are on subnetworks directly connected by a gateway.
  340.  
  341.             HOST A                                    HOST B
  342.         ----------------                        ------------------
  343.         |   Sending    |                        |    Receiving   |
  344.         | Upper Layer  |                        |    Upper Layer |
  345.         |  Protocol    |        GATEWAY         |     Protocol   |
  346.         |      \       |   ------------------   |     /          |
  347.         |    IP Module |   |   IP Module    |   |  IP Module     |
  348.         |        \     |   |    /     \     |   |   /            |
  349.         |        SNP-1 |   | SNP-1    SNP-2 |   | SNP-2          |
  350.         ----------------   ------------------   ------------------
  351.                    \          /        \          /
  352.                    Local Subnet 1       Local Subnet 2
  353.  
  354.                        Basic Model of Operation
  355.  
  356.  
  357.  
  358.  
  359.       a.  The sending ULP passes its data to the IP module, along with
  360.           the destination internet address and other parameters.
  361.  
  362.       b.  The IP module prepares an IP header and attaches  the  ULP's
  363.           data  to  form  an  internet  datagram.  Then, the IP module
  364.           determines a local subnetwork address from  the  destination
  365.           internet  address.   In  this case, it is the address of the
  366.           gateway  to  the  destination  subnetwork.    The   internet
  367.           datagram  along  with  the local subnet address is passed to
  368.           the local subnetwork protocol (abbreviated as SNP).
  369.  
  370.       c.  The SNP creates a local subnetwork header and attaches it to
  371.           the  datagram  forming  a  subnetwork  packet.  The SNP then
  372.           transmits the packet across the local subnet.
  373.  
  374.  
  375.  
  376.                                         System Development Corporation
  377.      1 June 1981                    -5-                        IEN 186
  378.  
  379.  
  380.  
  381.                        <========= subnetwork packet =========>
  382.  
  383.                        +------+---------+---------/ /--------+
  384.                        |  *   |    *    |    *               |
  385.                        +--:---+----:----+----:---/ /---------+
  386.                           :        :         :
  387.                           :        :         :
  388.                           :        :      ULP data
  389.                           :     IP header
  390.                           :
  391.                        subnetwork header
  392.  
  393.  
  394.       d.  The packet arrives at the gateway connecting the  first  and
  395.           second  subnetworks.  The SNP of the first subnet strips off
  396.           the local subnetwork header and passes the remainder to  the
  397.           IP module.
  398.  
  399.       e.  The IP  module  determines  from  the  destination  internet
  400.           address in the IP header that the datagram is intended for a
  401.           host in the second subnet.  The IP  module  then  derives  a
  402.           local  subnetwork  address  for  the destination host.  That
  403.           address is passed along with the datagram to the SNP of  the
  404.           second subnetwork for delivery.
  405.  
  406.       f.  The second subnet's SNP builds a local subnetwork header and
  407.           appends the datagram to form a packet for the second subnet-
  408.           work.  That packet is transmitted across the  second  subnet
  409.           to the destination host.
  410.  
  411.       g.  The SNP of the destination host strips off the local subnet-
  412.           work  header  and  hands  the  remaining  datagram to the IP
  413.           module.
  414.  
  415.       h.  The IP module determines that the datagram is  bound  for  a
  416.           ULP within this host.  The data portion of the datagram, the
  417.           source internet address, and  other  option  parameters  are
  418.           passed to the ULP.
  419.  
  420.      Delivery of data across the internet is complete.
  421.  
  422.  
  423.  
  424.                                         System Development Corporation
  425.      1 June 1981                    -6-                        IEN 186
  426.  
  427.  
  428.      2.  DESCRIPTION OF SERVICES PROVIDED TO UPPER LAYERS
  429.  
  430.      This section describes the services offered by the Internet  Pro-
  431.      tocol to upper layer protocols (ULPs).  The goals of this section
  432.      are to provide the  motivation  for  protocol  mechanisms  and  a
  433.      definition of the functions provided by this protocol.
  434.  
  435.      The services provided by IP are:
  436.  
  437.      o intact internet datagram service
  438.  
  439.      o virtual network service
  440.  
  441.      o error reporting service
  442.  
  443.  
  444.      A description of each service follows.
  445.  
  446.      2.1  Datagram Service
  447.  
  448.      The Internet Protocol shall provide a  datagram  service  between
  449.      homogeneous  upper layer protocols in an internet environment.  A
  450.      datagram service is characterized by data delivery to the  desti-
  451.      nation with non-zero probability; some data may possibly be lost.
  452.      Also, a  datagram  service  does  not  necessarily  preserve  the
  453.      sequence in which data is supplied by the source upon delivery at
  454.      the destination.
  455.  
  456.      IP shall deliver received data to a destination ULP in  the  same
  457.      form  as sent by the source ULP.  IP shall discard datagrams when
  458.      insufficient resources are available for processing.  IP does not
  459.      detect datagrams lost or discarded by the subnetwork layer.
  460.  
  461.      As part of the delivery service, IP insulates upper layer  proto-
  462.      cols  from  subnetwork specific characteristics.  For example, IP
  463.      maps internet addresses supplied by  ULPs  into  local  addresses
  464.      used  by  the  local  subnetwork.  Also, IP hides any packet-size
  465.      restrictions of subnetworks along the  transmission  path  within
  466.      the internet.
  467.  
  468.  
  469.      2.2  Virtual Network Services
  470.  
  471.      IP shall provide to upper layer protocols the ability  to  select
  472.      virtual  network service parameters.  IP shall provide a standard
  473.      command set for the ULPs to indicate the services desired.  Thus,
  474.      the  ULPs  can  tune  certain properties of IP and the underlying
  475.      subnetworks to customize the transmission  service  according  to
  476.      their needs.
  477.  
  478.      The virtual network parameters fall into two categories:  service
  479.      quality   parameters   and   service  options.   Service  quality
  480.  
  481.  
  482.  
  483.                                         System Development Corporation
  484.      1 June 1981                    -7-                        IEN 186
  485.  
  486.  
  487.      parameters influence the transmission  service  provided  by  the
  488.      subnetworks;   service  options are additional functions provided
  489.      by IP.  A brief description of each follows:
  490.  
  491.      o Service Quality Parameters
  492.  
  493.          - Precedence  :  attempts  preferential  treatment  for  high
  494.            importance datagrams
  495.  
  496.          - Transmission  Mode  :  datagram  vs.  stream.  Stream  mode
  497.            attempts  to  minimize  delay  and delay dispersion through
  498.            reservation of network resources
  499.  
  500.          - Reliability : attempts to minimize data loss and error rate
  501.  
  502.          - Speed : attempts prompt delivery
  503.  
  504.          - Resource Tradeoff : indicates relative importance of  speed
  505.            vs. reliability.
  506.  
  507.      o Service Options
  508.  
  509.          - Security  Labelling  :  identifies  datagram  for  compart-
  510.            mented hosts
  511.  
  512.          - Source Routing : selects set of gateway IP modules to visit
  513.            in transit
  514.  
  515.          - Route Recording : records gateway IP modules encountered in
  516.            transit
  517.  
  518.          - Stream Identification : names reserved resources  used  for
  519.            stream service
  520.  
  521.          - Time Stamping : records time information
  522.  
  523.          - Don't Fragment : marks a datagram as an indivisible unit
  524.  
  525.  
  526.      2.3  Error Reporting Service
  527.  
  528.      IP shall provide error reports to the upper layer protocols indi-
  529.      cating   errors  detected  in  providing  the above services.  In
  530.      addition, certain errors detected by lower layer protocols  shall
  531.      be passed to the ULPs.  These reports indicate several classes of
  532.      errors including invalid arguments, insufficient  resources,  and
  533.      transmission errors.  The errors that IP must report to ULPs have
  534.      not been defined.  IP's  error  reporting  responsibilities  need
  535.      further examination.
  536.  
  537.  
  538.  
  539.                                         System Development Corporation
  540.      1 June 1981                    -8-                        IEN 186
  541.  
  542.  
  543.      3.  UPPER LAYER SERVICE/INTERFACE SPECIFICATION
  544.  
  545.      This section specifies the IP services provided  to  upper  layer
  546.      protocols  and  the  interface  through  which these services are
  547.      accessed.  The first part defines the interaction primitives  and
  548.      interface  parameters  for  the upper interface.  The second part
  549.      contains the abstract machine specification of  the  upper  layer
  550.      services and interaction discipline.
  551.  
  552.  
  553.      3.1  Interaction Primitives
  554.  
  555.      An interaction primitive  defines  the  purpose  and  content  of
  556.      information  exchanged  between  two protocol layers.  Primitives
  557.      are grouped into two classes based on the direction  of  informa-
  558.      tion  flow.  Information passed downward, in this case from a ULP
  559.      to IP, is called a service request primitive.  Information passed
  560.      upward,  in  this  case  from  IP  to  a ULP, is called a service
  561.      response primitive.  Interaction primitives  need  not  occur  in
  562.      pairs.   That  is,  a  request  does  not  necessarily  elicit  a
  563.      "response"; a "response" may occur independently of a request.
  564.  
  565.      The information associated with an  interaction  primitive  falls
  566.      into   two  categories:  parameters  and  data.   The  parameters
  567.      describe the data and indicate how the data  is  to  be  treated.
  568.      The  data is not examined or modified.  The format of the parame-
  569.      ters and data  is  implementation  dependent  and  therefore  not
  570.      specified.
  571.  
  572.      A given IP implementation may have slightly different interaction
  573.      primitives  imposed by the execution environment or system design
  574.      factors.  In those cases,  the  primitives  can  be  modified  to
  575.      include  more information or additional primitives can be defined
  576.      to satisfy system requirements.  However, all IPs must provide at
  577.      least  the  interaction  primitives  specified below to guarantee
  578.      that all IP implementations can support the same protocol hierar-
  579.      chy.
  580.  
  581.  
  582.      3.1.1  Service Request Primitives
  583.  
  584.      A single service request primitive supports  IP's  datagram  ser-
  585.      vice, the SEND primitive.
  586.  
  587.      3.1.1.1  SEND
  588.  
  589.      The SEND primitive contains complete control information for each
  590.      unit  of data to be delivered.  IP accepts in a SEND at least the
  591.      following information:
  592.  
  593.      o source address - internet address of ULP sending data
  594.  
  595.  
  596.  
  597.                                         System Development Corporation
  598.      1 June 1981                    -9-                        IEN 186
  599.  
  600.  
  601.      o destination address - internet address of ULP to receive data
  602.  
  603.      o protocol - name of the recipient ULP
  604.  
  605.      o type of service  indicators  -  relative  transmission  quality
  606.       associated with unit of data
  607.  
  608.          - precedence - one of five levels : (P1, P2,  P3,  P4,  P5  )
  609.                         where P1 <= P2 <= P3 <= P4 <= P5
  610.  
  611.          - reliability - one  of  four  levels  :  (R1,  R2,  R3,  R4)
  612.                          where R1 <= R2 <= R3 <= R4
  613.  
  614.          - speed - one of two levels : (S1, S2) where S1 <= S2
  615.  
  616.          - resource trade-off  -  speed  or  reliability  :  (T1,  T2)
  617.                                 where T1 = speed, T2 = reliability
  618.  
  619.          - transmission mode - stream or datagram  :  (M1,  M2)  where
  620.                                M1 = stream, M2 = datagram
  621.  
  622.      o identifier - value distinguishing this  portion  of  data  from
  623.       others sent by this ULP.
  624.  
  625.      o don't fragment indicator - flag showing whether IP can fragment
  626.       data to accomplish delivery
  627.  
  628.      o time to live - value in seconds indicating maximum lifetime  of
  629.       data within the internet
  630.  
  631.      o data length - size of data being transmitted
  632.  
  633.      o option data - options requested by  ULP  from  following  list:
  634.       security, source routing, return routing, stream identification,
  635.       or time stamp. (See section 6.2.14.)
  636.  
  637.      o data - present when data length is greater than zero.
  638.  
  639.      3.1.2  Service Response Primitives
  640.  
  641.      A single service response primitive supports IP's  datagram  ser-
  642.      vice, the DELIVER primitive.
  643.  
  644.      3.1.2.1  DELIVER
  645.  
  646.      The DELIVER primitive contains the data passed by a source ULP in
  647.      a  SEND,  along  with  addressing, quality of service, and option
  648.      information.  IP passes in  a  DELIVER  at  least  the  following
  649.      information:
  650.  
  651.      o source address - internet address of sending ULP
  652.  
  653.  
  654.  
  655.                                         System Development Corporation
  656.      1 June 1981                   -10-                        IEN 186
  657.  
  658.  
  659.      o destination address - internet address of the recipient ULP
  660.  
  661.      o protocol - name of recipient ULP as supplied by the sending ULP
  662.  
  663.      o type of service  indicators  -  relative  transmission  quality
  664.       associated with unit of data
  665.  
  666.          - precedence - one of five levels : (P1, P2,  P3,  P4,  P5  )
  667.                         where P1 <= P2 <= P3 <= P4 <= P5
  668.  
  669.          - reliability - one  of  four  levels  :  (R1,  R2,  R3,  R4)
  670.                          where R1 <= R2 <= R3 <= R4
  671.  
  672.          - speed - one of two levels : (S1, S2) where S1 <= S2
  673.  
  674.          - resource trade-off  -  speed  or  reliability  :  (T1,  T2)
  675.                                 where T1 = speed, T2 = reliability
  676.  
  677.          - transmission mode - stream or datagram  :  (M1,  M2)  where
  678.                                M1 = stream, M2 = datagram
  679.  
  680.      o data length - number of octets of received data (possibly zero)
  681.  
  682.      o option data - options requested by source  ULP  from  following
  683.       list: security, source routing, return routing, stream identifi-
  684.       cation, or time stamps. (See section 6.2.14.)
  685.  
  686.      o data - present when data length is greater than zero.
  687.  
  688.      In addition, a DELIVER may contain error reports from  IP  either
  689.      together with parameters and data listed above, or, independently
  690.      of that information.  This area  needs  further  examination  and
  691.      definition.
  692.  
  693.      3.2  Abstract Machine Definition of Upper Level Services and
  694.           Interaction Discipline
  695.  
  696.      The abstract machine defines the behavior of the  entire  service
  697.      machine  from  the  perspective  of the upper layer protocol.  An
  698.      abstract machine definition is composed of a machine  identifier,
  699.      a  state  diagram,  a  state vector, a set of data structures, an
  700.      event list, and an events and actions correspondence.
  701.  
  702.      3.2.1  Machine Identifier
  703.  
  704.      Each upper interface state machine is uniquely identified by  the
  705.      four values:
  706.  
  707.      o source address
  708.  
  709.      o destination address
  710.  
  711.  
  712.  
  713.                                         System Development Corporation
  714.      1 June 1981                   -11-                        IEN 186
  715.  
  716.  
  717.      o protocol
  718.  
  719.      o identifier
  720.  
  721.      3.2.2  State Diagram
  722.  
  723.      The upper interface state machine has a single state which  never
  724.      changes.  No diagram is needed.
  725.  
  726.  
  727.      3.2.3  State Vector
  728.  
  729.      The upper interface state machine has a single state which  never
  730.      changes.  No state vector is needed.
  731.  
  732.  
  733.      3.2.4  State Machine Data Structures
  734.  
  735.      No data  structures  are  used  for  the  upper  interface  state
  736.      machine.   However, the following abbreviations are used to refer
  737.      to parameters of the interaction primitives:
  738.  
  739.           S = source internet address
  740.           D = destination internet address
  741.           P = protocol identifier
  742.           TOS = type of service where
  743.                     p(i) = one of the precedence levels (P1, P2, P3, P4, P5)
  744.                        (Note: read p(i) as "p sub i")
  745.                     r(i) = one of the reliability levels (R1, R2, R3, R4)
  746.                     s(i) = one of the speed levels (S1, S2)
  747.                     t(i) = one of the resource trade-offs (T1, T2)
  748.                     m(i) = one of the transmission modes (M1, M2)
  749.           ID = data identifier
  750.           TTL = time to live value
  751.           DF = don't fragment flag
  752.           Opts = the set of desired options including zero or more
  753.                  of the following:
  754.                     sr = source route
  755.                     rr = return route
  756.                     sl = security labelling
  757.                     sid = stream identifier
  758.                     its = internet timestamp
  759.                     sts = satellite timestamp
  760.           Data = data unit for delivery
  761.           L = length of data unit
  762.           t = time of event initiation
  763.           N = time elapsed during transmission
  764.  
  765.  
  766.  
  767.                                         System Development Corporation
  768.      1 June 1981                   -12-                        IEN 186
  769.  
  770.  
  771.      3.2.5  Event List
  772.  
  773.      The events are drawn from the interaction primitives specified in
  774.      section  3.1  above.  An event is composed of a service primitive
  775.      and an abstract timestamp to indicate the time of  event  initia-
  776.      tion.  The event list:
  777.  
  778.       1.  SEND( S, D, P, TOS(p(i), r(i), s(i), t(i), m(i)),  ID,  TTL,
  779.           DF, Opts(sr, rr, sl, sid, its, sts), Data, L) at time t
  780.  
  781.       2.  NULL - Although no service request is issued by ULP, certain
  782.           conditions  within  IP  or  lower  layers  produce a service
  783.           response.
  784.  
  785.  
  786.  
  787.      3.2.6  Events and Actions
  788.  
  789.      The following section defines the set of  possible  actions  eli-
  790.      cited by each event.
  791.  
  792.  
  793.      EVENT = SEND( S, D, P, TOS(p(i), r(i), s(i), t(i), m(i)), ID, TTL, DF,
  794.                   Opt(sr, rr, sl, sid, its, sts), Data, L ) at time t
  795.  
  796.         Actions:
  797.  
  798.             1. DELIVER Data at time t+N to protocol P at destination D
  799.                with all of the following properties:
  800.  
  801.                    a. The time elapsed during data transmission satisfies
  802.                       the time-to-live limit, i.e. N <= TTL.
  803.  
  804.                    b. The quality of data transmission is at least
  805.                       equal to the relative levels specified by
  806.                       TOS(p(i), r(i), s(i), t(i), m(i)).
  807.  
  808.                    c. if (DF = TRUE)
  809.                       then IP fragmentation has not occurred in transit.
  810.  
  811.                    d. if (Opts contains sr)
  812.                       then Data has visited in transit at least the nodes
  813.                             named by source route provided in SEND.
  814.  
  815.                    e. if (Opts contains rr)
  816.                       then the list of nodes visited in transit is
  817.                            delivered with Data.
  818.  
  819.                    f. if (Opts contains sl)
  820.                       then the security label is delivered with Data.
  821.  
  822.                    g. if (Opts contains sid)
  823.  
  824.  
  825.  
  826.                                         System Development Corporation
  827.      1 June 1981                   -13-                        IEN 186
  828.  
  829.  
  830.                       then the stream identifier is delivered with Data
  831.  
  832.                    h. if (Opts contains its)
  833.                       then the internet timestamp is delivered with Data
  834.  
  835.                    j. if (Opts contains sts)
  836.                       then the satellite timestamp is delivered with Data
  837.  
  838.           OR,
  839.             2. DELIVER to protocol P at source S indicating one of
  840.                the following error conditions:
  841.  
  842.                     a. destination D unreachable
  843.  
  844.                     b. protocol P unreachable
  845.  
  846.                     c. if (DF = TRUE)
  847.                        then fragmentation needed but prohibited
  848.  
  849.                     d. if (Opts contains any option)
  850.                        then parameter problem with option.
  851.  
  852.           OR,
  853.             3. no action
  854.  
  855.  
  856.  
  857.       EVENT = NULL
  858.  
  859.           Actions:
  860.  
  861.             1. DELIVER to protocol P at source S indicating
  862.                the following error condition:
  863.  
  864.                    a. error conditions in subnet layer
  865.  
  866.  
  867.  
  868.                                         System Development Corporation
  869.      1 June 1981                   -14-                        IEN 186
  870.  
  871.  
  872.      4.  DESCRIPTION OF LOWER LAYER SERVICE REQUIREMENTS
  873.  
  874.      This section describes the minimal services required of the  sub-
  875.      network layer.
  876.      The services required are:
  877.  
  878.      o transparent data transfer between hosts within a subnetwork
  879.  
  880.      o error reporting
  881.  
  882.      A description of each service follows.
  883.  
  884.      4.1  Data Transfer
  885.  
  886.      The subnetwork layer must provide  a  transparent  data  transfer
  887.      between  hosts  within  a single subnetwork.  Only the data to be
  888.      delivered, and the necessary control and  addressing  information
  889.      should  be  required as input from IP.  Intranet routing and sub-
  890.      network operation  shall  be  handled  by  the  subnetwork  layer
  891.      itself.
  892.  
  893.      The subnetwork need not  be  a  reliable  communications  medium.
  894.      Data  should  arrive  with non-zero probability at a destination.
  895.      Data may not necessarily arrive in the same order as it was  sup-
  896.      plied  to  the subnetwork layer, nor is data guaranteed to arrive
  897.      error free.
  898.  
  899.      4.2  Error Reporting
  900.  
  901.      The subnetwork layer  shall  provide  reports  to  IP  indicating
  902.      errors from the subnetwork and lower layers as feasible.
  903.      The specific error requirements of the subnetwork layer have  not
  904.      been defined.  This area needs further examination.
  905.  
  906.  
  907.  
  908.                                         System Development Corporation
  909.      1 June 1981                   -15-                        IEN 186
  910.  
  911.  
  912.      5.  LOWER LAYER SERVICE/INTERFACE SPECIFICATION
  913.  
  914.      This section specifies the minimal subnetwork  protocol  services
  915.      required by IP and the interface through which those services are
  916.      accessed.  The first part defines the interaction primitives  and
  917.      their  parameters  for the lower interface.  The second part con-
  918.      tains the abstract machine specification of the lower layer  ser-
  919.      vices and interaction discipline.
  920.  
  921.      5.1  Interaction Primitives
  922.  
  923.      An interaction primitive defines  the  purpose  and  contents  of
  924.      information  exchanged between two protocol layers.  Two kinds of
  925.      primitives, based on  the  direction  of  information  flow,  are
  926.      defined.   Service  requests  pass  information downward; service
  927.      responses pass information upward.   These  primitives  need  not
  928.      occur  in pairs, nor in a synchronous manner.  That is, a request
  929.      does not necessarily elicit a "response"; a "response" may  occur
  930.      independently of a request.
  931.  
  932.      The information associated with an  interaction  primitive  falls
  933.      into   two  categories:  parameters  and  data.   The  parameters
  934.      describe the data and indicate how the data  is  to  be  treated.
  935.      The  data is not examined or modified.  The format of interaction
  936.      primitive information is implementation dependent and so  is  not
  937.      specified.
  938.  
  939.      A given IP implementation may have slightly different  interfaces
  940.      imposed by the nature of the subnetwork or execution environment.
  941.      Under such circumstances,  the  primitives  can  be  modified  to
  942.      include  more  parameters or include additional primitives can be
  943.      defined.  However, all IPs must provide at  least  the  interface
  944.      specified below to guarantee that all IP implementations can sup-
  945.      port the same protocol hierarchy.
  946.  
  947.  
  948.      5.1.1  Service Request Primitives
  949.  
  950.      A single service request primitive is required from  the  SNP,  a
  951.      SNP_SEND primitive.
  952.  
  953.      5.1.1.1  SNP_SEND
  954.  
  955.      The SNP_SEND contains an IP datagram, a destination, and  parame-
  956.      ters  describing  the  desired  transmission  quality.   The  SNP
  957.      receives in an SNP_SEND at least the following information:
  958.  
  959.      o local destination address - local subnetwork address of  desti-
  960.       nation host or gateway
  961.  
  962.      o type of service  indicators  -  relative  transmission  quality
  963.       associated with the datagram
  964.  
  965.  
  966.  
  967.                                         System Development Corporation
  968.      1 June 1981                   -16-                        IEN 186
  969.  
  970.  
  971.          - precedence - one of five levels : (P1, P2,  P3,  P4,  P5  )
  972.                         where P1 <= P2 <= P3 <= P4 <= P5
  973.  
  974.          - reliability - one  of  four  levels  :  (R1,  R2,  R3,  R4)
  975.                          where R1 <= R2 <= R3 <= R4
  976.  
  977.          - speed - one of two levels : (S1, S2) where S1 <= S2
  978.  
  979.          - resource trade-off  -  speed  or  reliability  :  (T1,  T2)
  980.                                 where T1 = speed, T2 = reliability
  981.  
  982.          - transmission mode - stream or datagram  :  (M1,  M2)  where
  983.                                M1 = stream, M2 = datagram
  984.  
  985.      o length - size of the datagram
  986.  
  987.      o datagram
  988.  
  989.      5.1.2  Service Response Primitives
  990.  
  991.      One  service  request  primitive  is  required  to  support  IP's
  992.      datagram service, the SNP_DELIVER primitive.
  993.  
  994.      5.1.2.1  SNP_DELIVER
  995.  
  996.      The SNP_DELIVER contains only a datagram which is an  independent
  997.      entity  containing  all  the  information  needed  by  IP.  An IP
  998.      receives in an SNP_DELIVER at least the following information:
  999.  
  1000.      o datagram
  1001.  
  1002.      In addition, a SNP_DELIVER may contain  error  reports  from  the
  1003.      SNP,  either  together  with  a datagram or independently of one.
  1004.      This area needs further examination and definition.
  1005.  
  1006.  
  1007.  
  1008.      5.2  Abstract Machine Definition of Lower Level Services and
  1009.           Interaction Discipline
  1010.  
  1011.      The abstract state machine defines the  behavior  of  the  entire
  1012.      service  machine  with  respect  to the lower layer protocol.  An
  1013.      abstract machine definition is composed of a machine  identifier,
  1014.      a  state  diagram,  a  state vector, a set of data structures, an
  1015.      event list, and an events and actions correspondence.
  1016.  
  1017.      5.2.1  Machine Identifier
  1018.  
  1019.      Each lower interface state machine is uniquely identified by  the
  1020.      four values:
  1021.  
  1022.  
  1023.  
  1024.                                         System Development Corporation
  1025.      1 June 1981                   -17-                        IEN 186
  1026.  
  1027.  
  1028.      o source address
  1029.  
  1030.      o destination address
  1031.  
  1032.      o protocol
  1033.  
  1034.      o identification
  1035.  
  1036.      5.2.2  State Diagram
  1037.  
  1038.      The lower interface state machine has a single state which  never
  1039.      changes.  No diagram is needed.
  1040.  
  1041.  
  1042.      5.2.3  State Vector
  1043.  
  1044.      No state vector is needed for the lower interface state machine.
  1045.  
  1046.  
  1047.      5.2.4  State Machine Data Structures
  1048.  
  1049.      No data  structures  are  used  for  the  lower  interface  state
  1050.      machine.   However, the following abbreviations are used to refer
  1051.      to parameters of the interaction primitives:
  1052.  
  1053.           LD = local subnetwork destination address
  1054.           TOS = type of service where
  1055.                     p(i) = one of the precedence levels (P1, P2, P3, P4, P5)
  1056.                        (Note: read p(i) as "p sub i")
  1057.                     r(i) = one of the reliability levels (R1, R2, R3, R4)
  1058.                     s(i) = one of the speed levels (S1, S2)
  1059.                     t(i) = one of the resource trade-offs (T1, T2)
  1060.                     m(i) = one of the transmission modes (M1, M2)
  1061.           L = datagram length
  1062.  
  1063.  
  1064.  
  1065.      5.2.5  Event List
  1066.  
  1067.      The events are drawn from the interactions  primitives  specified
  1068.      in  section  5.1 above.  An event is composed of a service primi-
  1069.      tive with its parameters and data.
  1070.  
  1071.       1.  SNP_SEND(  LD,  TOS(p(i),  r(i),  s(i),  t(i),   m(i)),   L,
  1072.           Datagram)
  1073.  
  1074.       2.  NULL - Although IP issues no service request, certain condi-
  1075.           tions within the subnet layer elicit a service response.
  1076.  
  1077.  
  1078.  
  1079.                                         System Development Corporation
  1080.      1 June 1981                   -18-                        IEN 186
  1081.  
  1082.  
  1083.      5.2.6  Events and Actions
  1084.  
  1085.      The following section defines the set of  possible  actions  eli-
  1086.      cited by each event.
  1087.  
  1088.      EVENT = SNP_SEND( LD, TOS(p(i), r(i), s(i), t(i), m(i)), L, Datagram)
  1089.  
  1090.           ACTIONS:
  1091.  
  1092.                1. SNP_DELIVER Datagram to IP at local destination LD with
  1093.                   all of the following properties:
  1094.  
  1095.                    a. The quality of data transmission is at least
  1096.                       equal to the relative levels specified by
  1097.                       TOS(p(i), r(i), s(i), t(i), m(i)).
  1098.  
  1099.              OR,
  1100.                2. no action
  1101.  
  1102.  
  1103.      EVENT = NULL
  1104.  
  1105.           ACTIONS:
  1106.  
  1107.                1. SNP_DELIVER to IP indicating the following error condition:
  1108.  
  1109.                     a. error conditions within the subnet layer
  1110.  
  1111.  
  1112.  
  1113.                                         System Development Corporation
  1114.      1 June 1981                   -19-                        IEN 186
  1115.  
  1116.  
  1117.      6.  MECHANISM SPECIFICATION
  1118.  
  1119.      This section  defines  the  mechanisms  supporting  the  services
  1120.      offered  by  IP.    The  first  subsection motivates the specific
  1121.      mechanisms chosen and  discusses  the  underlying  philosophy  of
  1122.      those  choices.  The second subsection defines the format and use
  1123.      of the IP header fields.  The last subsection specifies the  peer
  1124.      protocol interactions with a state machine model.
  1125.  
  1126.      6.1  Overview of IP Mechanisms
  1127.  
  1128.      The IP mechanisms are motivated by the IP services, described  in
  1129.      section 2:
  1130.  
  1131.      o intact datagram delivery service
  1132.  
  1133.      o virtual network service
  1134.  
  1135.      o error reporting service
  1136.  
  1137.      Each service could be supported by any of a  set  of  mechanisms.
  1138.      The selection of mechanisms is guided by design standards includ-
  1139.      ing simplicity, generality,  flexibility,  and  efficiency.   The
  1140.      following mechanism descriptions identify the service or services
  1141.      supported, discuss the design criteria  used  in  selection,  and
  1142.      explain how the mechanisms work.
  1143.  
  1144.      6.1.1  Routing Mechanism
  1145.  
  1146.      IP contains an adaptive routing mechanism to support the delivery
  1147.      service.   The  routing  mechanism  uses  the internet addressing
  1148.      scheme and internet topology data to direct datagrams  along  the
  1149.      best path between source and destination.  The mechanism provides
  1150.      routing options for ULPs needing the  flexibility  to  select  or
  1151.      record routes and routing information.
  1152.  
  1153.      A distinction is made between names, addresses,  and  routes.   A
  1154.      name  indicates the object sought independently of physical loca-
  1155.      tion.  An address indicates where the object is.  A  route  indi-
  1156.      cates  how to get there. It is the task of the upper layer proto-
  1157.      cols to map from names to addresses.  The internet protocol  maps
  1158.      from  internet  addresses  to  local  subnet addresses to perform
  1159.      routing through the internet.  It is the task of lower layer pro-
  1160.      tocols  to  map from the local subnet addresses to routes through
  1161.      local subnetworks.
  1162.  
  1163.      Internet addresses have a fixed length of four octets (32  bits).
  1164.      An  internet  address  begins with a one octet network number and
  1165.      ends with a three octet REST field.  The REST field usually  con-
  1166.      tains a local subnetwork address.  However, alternate schemes for
  1167.      use of this field can extend the address range to allow more sub-
  1168.      networks on the internet.
  1169.  
  1170.  
  1171.  
  1172.                                         System Development Corporation
  1173.      1 June 1981                   -20-                        IEN 186
  1174.  
  1175.  
  1176.           0                   1                   2             3
  1177.           0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1     8 9 0 1
  1178.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+/ /+-+-+-+-+
  1179.          |    NETWORK    |       REST                            |
  1180.          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-/ /-+-+-+-+-+
  1181.  
  1182.  
  1183.      The 24-bit REST field, assigned by each local subnetwork,  should
  1184.      allow  for  a  single  physical  host  to act as several distinct
  1185.      internet hosts.  That is, there should exist  a  mapping  between
  1186.      internet  host  addresses  and  subnetwork/host  interfaces  that
  1187.      allows several internet addresses to correspond to one interface.
  1188.      A  host  should  be  allowed  to have several physical interfaces
  1189.      (i.e. multi-homing) and to treat the datagrams  from  several  of
  1190.      them as if they were all addressed to a single host.
  1191.  
  1192.      To route a datagram, an IP module examines the NETWORK  field  of
  1193.      the internet address indicating the destination for the datagram.
  1194.      If the network number is the same as the IP module's  subnetwork,
  1195.      the  module uses the REST field of the internet address to derive
  1196.      the local subnet address of the destination host.  If the network
  1197.      number  doesn't  match,  the  module  determines  a  local subnet
  1198.      address of a gateway on the best path to the destination  subnet-
  1199.      work.  In turn, the gateway IP module derives the next local sub-
  1200.      net address to either a  host  or  gateway.   In  this  way,  the
  1201.      datagram is relayed through the internet to the destination host.
  1202.  
  1203.      In a static environment, the routing  algorithm  is  straightfor-
  1204.      ward.  However, internet topology tends to change due to hardware
  1205.      or software failure, host availability,  or  heavy  traffic  load
  1206.      conditions.  So, each host and gateway IP along the gateway route
  1207.      also uses its current knowledge  of  internet  topology  to  make
  1208.      routing decisions.
  1209.  
  1210.      6.1.1.1  Routing Options
  1211.  
  1212.      IP provides a mechanism, called source routing, to  override  the
  1213.      gateway's  independent  routing decisions.  This mechanism allows
  1214.      an upper layer protocol to influence the gateway route a datagram
  1215.      traverses.  The ULP can pass a list of internet addresses, called
  1216.      a source route, along with a datagram.  Each address on the  list
  1217.      is  an  intermediate  destination.  The source IP module uses its
  1218.      normal routing mechanism to transmit the datagram  to  the  first
  1219.      address on the list.  At that address, the first entry is removed
  1220.      from the list, and the next address becomes the datagram's desti-
  1221.      nation.   When  the last entry of the list is removed, the normal
  1222.      destination address field becomes the final destination.
  1223.  
  1224.      For  testing  or  diagnostic  purposes,  a  ULP  can  acquire   a
  1225.      datagram's gateway route by using a mechanism called return rout-
  1226.      ing.  The sending ULP indicates that a record of the route is  to
  1227.      be  accumulated  in  transit.   Then, as gateway IP module on the
  1228.  
  1229.  
  1230.  
  1231.                                         System Development Corporation
  1232.      1 June 1981                   -21-                        IEN 186
  1233.  
  1234.  
  1235.      gateway route relays the datagram, it adds  its  address  to  the
  1236.      return  list.  The destination ULP receives the original datagram
  1237.      along with the return list containing the gateway route.
  1238.  
  1239.      6.1.2  Fragmentation and Reassembly
  1240.  
  1241.      IP contains a fragmentation mechanism to break a  large  datagram
  1242.      into  smaller  datagrams.   This  is  a more general solution for
  1243.      overcoming differences between subnetwork capacity than legislat-
  1244.      ing a restrictive datagram size small enough for every subnetwork
  1245.      on the internet.  This  mechanism  can  be  overriden  using  the
  1246.      "don't  fragment"  option to prevent fragmentation.  IP also con-
  1247.      tains a reassembly mechanism which reverses the fragmentation  to
  1248.      enable delivery of intact data portions.
  1249.  
  1250.      When an IP module encounters a datagram that is  too  big  to  be
  1251.      transmitted  through  a  subnetwork, it applies its fragmentation
  1252.      mechanism.  First, the module divides the  data  portion  of  the
  1253.      datagram  into two or more pieces.  The data must be broken on 8-
  1254.      octet boundaries. For each  piece,  it  then  builds  a  datagram
  1255.      header  containing  the  identification,  addressing, and options
  1256.      information needed.  Fragmentation data is adjusted  in  the  new
  1257.      headers  to correspond to the data's relative position within the
  1258.      original datagram.  The result  is  a  set  of  small  datagrams,
  1259.      called  fragments,  each  carrying a portion of the data from the
  1260.      original large datagram.  Section 6.3.7.8 defines the  fragmenta-
  1261.      tion algorithm.
  1262.  
  1263.      Each fragment is handled independently until the  destination  IP
  1264.      module  is  reached.   The fragments may follow different gateway
  1265.      routes as internet topology and traffic conditions change.   They
  1266.      are  also  subject  to  further fragmentation if 'smaller-packet'
  1267.      subnetworks are subsequently traversed.
  1268.  
  1269.      Every IP module must be able to forward a datagram of  68  octets
  1270.      without  further  fragmentation.  This  size  allows for a header
  1271.      length of up to 60 octets  and  the  minimum  data  length  of  8
  1272.      octets.
  1273.  
  1274.      To reassemble fragments into the original datagram, an IP  module
  1275.      combines  all  those received having the same value for the iden-
  1276.      tification, source address, destination  address,  and  protocol.
  1277.      IP  allocates reassembly resources when a "first-to-arrive" frag-
  1278.      ment is recognized.  Based  on  the  fragmentation  data  in  the
  1279.      header,  the  fragment is placed in a reassembly area relative to
  1280.      its position in the original datagram.  When  all  the  fragments
  1281.      have been received, the IP module passes the data in its original
  1282.      form to the destination ULP.
  1283.  
  1284.      All hosts must be prepared to  accept  datagrams  of  up  to  576
  1285.      octets (whether they arrive whole or in fragments).  It is recom-
  1286.      mended that hosts only send datagrams larger than 576  octets  if
  1287.  
  1288.  
  1289.  
  1290.                                         System Development Corporation
  1291.      1 June 1981                   -22-                        IEN 186
  1292.  
  1293.  
  1294.      they  have  assurance  that the destination is prepared to accept
  1295.      the larger datagrams.  The number 576 is selected to allow a rea-
  1296.      sonable  amount  of  data  to  be  transmitted in addition to the
  1297.      required header information.  For example,  this  size  allows  a
  1298.      data  block  of  512  octets  plus  64  header octets to fit in a
  1299.      datagram.  The maximum internet header size is 60 octets,  and  a
  1300.      typical  internet  header  is  20  octets,  allowing a margin for
  1301.      headers of upper layer protocols.
  1302.  
  1303.      Because the subnetwork may be unreliable, some  fragments  making
  1304.      up  a  complete datagram can be lost.  IP uses the "time-to-live"
  1305.      data (explained in section 6.1.4 below) to set  a  timer  on  the
  1306.      reassembly  process.   If  the timer expires before all the frag-
  1307.      ments have been collected, IP discards the partially  reassembled
  1308.      datagram.
  1309.  
  1310.      Only the destination IP module should perform  reassembly.   This
  1311.      recommendation  is intended to reduce gateway overhead and minim-
  1312.      ize the chance of deadlock[3].  However,  reassembly  by  private
  1313.      agreement  between  gateways  is  transparent  to the rest of the
  1314.      internet and is allowed.
  1315.  
  1316.      A ULP can prevent its data from being broken into smaller  pieces
  1317.      during transmission.  IP provides an override mechanism to prohi-
  1318.      bit fragmentation called "Don't Fragment."  Any internet datagram
  1319.      marked  "don't  fragment"  cannot  be  fragmented by an IP module
  1320.      along the gateway route under any circumstances.  If an IP module
  1321.      cannot  deliver  such a datagram to its destination without frag-
  1322.      menting it, the module discards the datagram and returns an error
  1323.      to the source IP.  (Please note that fragmentation, transmission,
  1324.      and reassembly at the subnetwork layer is transparent to  IP  and
  1325.      can be used at any time.)
  1326.  
  1327.      6.1.3  Checksum
  1328.  
  1329.      IP assumes the subnetwork layer to be  unreliable  regardless  of
  1330.      the actual subnetwork protocol present.  So, IP provides a check-
  1331.      sum mechanism supporting the delivery service to protect  the  IP
  1332.      header from transmission errors.  The data portion is not covered
  1333.      by the IP checksum.
  1334.  
  1335.      An IP module recomputes the checksum each time the IP  header  is
  1336.      changed.   Changes  occur  during time-to-live reductions, option
  1337.      updates (both explained below), and fragmentation.  The  checksum
  1338.      is  currently a simple one's complement algorithm, and experimen-
  1339.      tal evidence indicates its adequacy.  However, the  algorithm  is
  1340.      provisional  and may be replaced by a CRC procedure, depending on
  1341.      future experience.
  1342.  
  1343.  
  1344.  
  1345.                                         System Development Corporation
  1346.      1 June 1981                   -23-                        IEN 186
  1347.  
  1348.  
  1349.      6.1.4  Time To Live
  1350.  
  1351.      As mentioned  in  the  routing  discussion  above,  a  datagram's
  1352.      transmission  path is subject to changes in internet topology and
  1353.      traffic conditions.  Inadvertently, a datagram might be routed on
  1354.      a  circuitous path to arrive at its destination after a consider-
  1355.      able delay.  Or, a  datagram  could  loop  through  the  same  IP
  1356.      modules  without  making  real  progress towards its destination.
  1357.      Such "old datagrams" reduce internet bandwidth and waste process-
  1358.      ing time.
  1359.  
  1360.      To prevent these problems, IP provides a mechanism to  limit  the
  1361.      lifetime  of  a  datagram,  called  time-to-live.  Along with the
  1362.      other sending parameters, a  ULP  specifies  a  maximum  datagram
  1363.      lifetime  in  second  units.  Each IP module on the gateway route
  1364.      decreases the time-to-live value carried in the IP header.  If an
  1365.      IP module receives an expired datagram, it discards the datagram.
  1366.      The lifetime limit is in effect  until  the  datagram's  data  is
  1367.      delivered  to  the  destination  ULP.   That is, if a datagram is
  1368.      fragmented during transmission, it can still  expire  during  the
  1369.      reassembly process.  Section 6.3.4.3 defines the reassembly algo-
  1370.      rithm use of the time-to-live data.
  1371.  
  1372.      6.1.5  Type of Service
  1373.  
  1374.      In support of the virtual network service, the  type  of  service
  1375.      mechanism allows upper layer protocols to select the transmission
  1376.      quality.  IP passes the type of service  (TOS)  command  set  for
  1377.      service  quality  to  the SNP where it is mapped into subnetwork-
  1378.      specific transmission parameters.  Not every subnetwork  supports
  1379.      all  transmission  services,  but  each  SNP on the delivery path
  1380.      should make a best effort to match the available subnet  services
  1381.      to the desired service quality.
  1382.  
  1383.      The TOS command set includes precedence level, reliability level,
  1384.      speed  level, resource trade-off, and transmission mode.  Several
  1385.      subnetworks offer a precedence service where treating  high  pre-
  1386.      cedence  traffic  is  processed before other traffic.  A few net-
  1387.      works offer a stream service, whereby one can achieve  low  delay
  1388.      and  constant  datagram  interarrival  time  by reserving network
  1389.      resources.  Another choice involves a low-delay vs.  high  relia-
  1390.      bility  trade-off.   Usually  subnetworks invoke more complex and
  1391.      delay producing mechanisms as the need for reliability increases.
  1392.  
  1393.      6.1.6  Data Options
  1394.  
  1395.      Motivated by the virtual network service, IP provides  a  mechan-
  1396.      ism,  called  options, to carry certain identification and timing
  1397.      data in a standard manner through the internet.  The use of  this
  1398.      mechanism  by  the ULPs is optional, as the name implies, but all
  1399.      options must be supported by each IP implementation.  No  perfor-
  1400.      mance  penalty  is exacted from other services because the option
  1401.  
  1402.  
  1403.  
  1404.                                         System Development Corporation
  1405.      1 June 1981                   -24-                        IEN 186
  1406.  
  1407.  
  1408.      data requires no additional processing by IP; it is simply passed
  1409.      on to the receiving ULP.
  1410.  
  1411.      The data options carry  three  kinds  of  information:  security,
  1412.      stream  identification, and timing.  The security data is used by
  1413.      DOD hosts needing to  transmit  security  and  TCC  (closed  user
  1414.      groups)  parameters  through  the  internet in a standard manner.
  1415.      The stream identification option provides  a  way  for  a  SATNET
  1416.      stream identifier to be carried both through stream-oriented sub-
  1417.      networks and subnets not supporting the stream concept.  The tim-
  1418.      ing  data,  useful for testing and diagnostics, includes internet
  1419.      timestamps and satellite timestamps.
  1420.  
  1421.  
  1422.      6.1.7  Error Report Datagrams
  1423.  
  1424.      The error reporting service motivates a mechanism to generate and
  1425.      process error information.  The error mechanism uses the datagram
  1426.      delivery service to transfer the errors between IP modules.
  1427.  
  1428.      An IP module encounters errors from three  sources:  ULPs,  SNPs,
  1429.      and  other  IP  modules.  Errors from the first two appear across
  1430.      IP's interfaces and are handled on the same medium.   But  errors
  1431.      from  IP  modules  are  found  in  or caused by datagrams and are
  1432.      reported to the source IP module in an "error report datagram."
  1433.  
  1434.      An error report datagram is composed of a minimal IP header and a
  1435.      data  portion  to  carry  error  information.   An  error  report
  1436.      datagram is distinguished from normal datagrams by  the  protocol
  1437.      field   being  equal  to  the Gateway-Gateway Protocol's identif-
  1438.      ier[13].  The error information includes a general error type, an
  1439.      error  code,  related error information, and portions of the dis-
  1440.      carded or erroneous datagram  causing  the  report.   The  errors
  1441.      reported include:
  1442.  
  1443.       a.  Destination Unreachable  -  A  gateway  or  host  IP  cannot
  1444.           deliver a datagram.
  1445.  
  1446.              - subnet unreachable - A gateway IP  cannot  determine  a
  1447.                route to the destination subnetwork.
  1448.  
  1449.              - host unreachable - A  gateway  IP  cannot  determine  a
  1450.                route to the destination host.
  1451.  
  1452.              - protocol unreachable - The IP module at the destination
  1453.                address  cannot deliver to the unknown or inactive pro-
  1454.                tocol.
  1455.  
  1456.              - port unreachable - The IP  module  at  the  destination
  1457.                address cannot deliver to the unknown or inactive port.
  1458.  
  1459.  
  1460.  
  1461.                                         System Development Corporation
  1462.      1 June 1981                   -25-                        IEN 186
  1463.  
  1464.  
  1465.              - fragmentation needed but DF set -  A  host  or  gateway
  1466.                cannot  deliver  a  datagram  because  fragmentation is
  1467.                required but is prohibited by the don't fragment flag.
  1468.  
  1469.       b.  Time Exceeded - A datagram has exceeded  its  allowed  life-
  1470.           time.
  1471.  
  1472.              - in transit - A gateway or host finds the time  to  live
  1473.                field  in the datagram header is zero.  The datagram is
  1474.                discarded.
  1475.  
  1476.              - during reassembly - The destination  host  cannot  com-
  1477.                plete reassembly within the time-to-live time limit due
  1478.                to missing fragments.
  1479.  
  1480.       c.  Parameter Problem - A gateway or  host  cannot  deliver  the
  1481.           datagram because of some problem with the header parameters.
  1482.  
  1483.              - Problem with an option - An option is either  not  sup-
  1484.                ported  or incorrect.  The third octet of the data por-
  1485.                tion contains the option type of the problem option.
  1486.  
  1487.       d.  Source Quench - A gateway has discarded a  datagram  due  to
  1488.           congestion.  This report request the source host to cut back
  1489.           the rate at which it is sending traffic to that destination.
  1490.  
  1491.       e.  Redirect - A gateway has received a datagram from a host  on
  1492.           an  attached  subnet, but must forward it to another gateway
  1493.           on the same subnet.  This message requests the source IP  to
  1494.           send  subsequent  datagrams with the same destination to the
  1495.           other gateway.  The address of the other gateway appears  in
  1496.           octets 4-7.
  1497.  
  1498.       f.  Echo - A host or gateway may use this  report  to  establish
  1499.           connectivity.
  1500.  
  1501.       g.  Type 0 : Echo Reply - A host or gateway responds to a previ-
  1502.           ous Echo.
  1503.  
  1504.  
  1505.  
  1506.                                         System Development Corporation
  1507.      1 June 1981                   -26-                        IEN 186
  1508.  
  1509.  
  1510.      6.2  Internet Protocol Header Format
  1511.  
  1512.  
  1513.      A summary of the contents of the IP header follows:
  1514.  
  1515.  
  1516.          0                   1                   2                   3
  1517.          0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1518.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1519.         |Version|  IHL  |Type of Service|          Total Length         |
  1520.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1521.         |         Identification        |Flags|      Fragment Offset    |
  1522.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1523.         |  Time to Live |    Protocol   |         Header Checksum       |
  1524.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1525.         |                       Source Address                          |
  1526.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1527.         |                    Destination Address                        |
  1528.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1529.         |                    Options                    |    Padding    |
  1530.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1531.  
  1532.                                  IP Header Format
  1533.  
  1534.  
  1535.      Note that each tick mark represents one bit position.  Each field
  1536.      description  below  includes  its  name, an abbreviation, and the
  1537.      field size. Where applicable,  the  units,  the  legal  range  of
  1538.      values, and a default value appears.
  1539.  
  1540.  
  1541.      6.2.1  Version
  1542.  
  1543.        abbrev: VER       field size: 4 bits
  1544.  
  1545.      The Version field indicates the format of the  IP  header.   This
  1546.      document describes version 4.
  1547.  
  1548.  
  1549.      6.2.2  Internet Header Length
  1550.  
  1551.        abbrev: IHL       field size: 4 bits
  1552.        units : 4-octets  range : 5 - 15      default : 5
  1553.  
  1554.      Internet Header Length is the length of the IP header  in  32-bit
  1555.      words,  and  thus points to the beginning of the data.  Note that
  1556.      the minimum value for a correct header is 5.
  1557.  
  1558.  
  1559.  
  1560.                                         System Development Corporation
  1561.      1 June 1981                   -27-                        IEN 186
  1562.  
  1563.  
  1564.      6.2.3  Type of Service
  1565.  
  1566.        abbrev: TOS       field size: 8 bits
  1567.  
  1568.      The Type of Service field contains the IP  parameters  describing
  1569.      the quality of service desired for this datagram.
  1570.  
  1571.  
  1572.               0     1     2     3     4     5     6     7
  1573.            +-----+-----+-----+-----+-----+-----+-----+-----+
  1574.            |                 |     |           |     |     |
  1575.            |   PRECEDENCE    | STRM|RELIABILITY| S/R |SPEED|
  1576.            |                 |     |           |     |     |
  1577.            +-----+-----+-----+-----+-----+-----+-----+-----+
  1578.  
  1579.            Bits 0-2:  Precedence.
  1580.            Bit    3:  Stream or Datagram.
  1581.            Bits 4-5:  Reliability.
  1582.            Bit    6:  Speed over Reliability.
  1583.            Bits   7:  Speed.
  1584.  
  1585.            PRECEDENCE          STRM      RELIABILITY  S/R      SPEED
  1586.            111-Flash Override  1-STREAM  11-highest   1-speed  1-high
  1587.            110-Flash           0-DTGRM   10-higher    0-rlblt  0-low
  1588.            10X-Immediate                 01-lower
  1589.            01X-Priority                  00-lowest
  1590.            00X-Routine
  1591.  
  1592.  
  1593.  
  1594.  
  1595.      6.2.4  Total Length
  1596.  
  1597.          abbrev: TL           field size: 16 bits
  1598.          units: octets        range : 20 - 65,535    default: 20
  1599.  
  1600.      Total Length is the length of the datagram, measured  in  octets,
  1601.      including header portion and the data portion of the datagram.
  1602.  
  1603.  
  1604.      6.2.5  Identification
  1605.  
  1606.           abbrev: ID     field size : 16 bits
  1607.  
  1608.      A identifying value used to associate fragments  of  a  datagram.
  1609.      This value is usually supplied by the sending ULP as an interface
  1610.      parameter.  If not, IP generates datagram  identifications  which
  1611.      are unique for each sending ULP.
  1612.  
  1613.  
  1614.  
  1615.                                         System Development Corporation
  1616.      1 June 1981                   -28-                        IEN 186
  1617.  
  1618.  
  1619.      6.2.6  Flags
  1620.  
  1621.           abbrev:  -     field size :  3 bits
  1622.  
  1623.  
  1624.      This field contains the  control  flags  "don't  fragment"  which
  1625.      prohibits  IP  fragmentation  and "more fragments" which helps to
  1626.      identify fragments.
  1627.  
  1628.                0   1   2
  1629.              +---+---+---+
  1630.              |   | D | M |
  1631.              | 0 | F | F |
  1632.              +---+---+---+
  1633.  
  1634.            Bit 0: reserved, must be zero
  1635.            Bit 1: Don't Fragment This Datagram (DF).
  1636.            Bit 2: More Fragments Flag (MF).
  1637.  
  1638.      6.2.7  Fragment Offset
  1639.  
  1640.           abbrev: FO                field size : 13 bits
  1641.           units : 8-octet groups    range : 0 - 8191    default : 0
  1642.  
  1643.      This field indicates the positions of this fragment's data  rela-
  1644.      tive  to  the  beginning  of  the  data  carried  in the original
  1645.      datagram.  Both a complete datagram and a first fragment has this
  1646.      field  set  to  zero.   Section 6.1.2 describes the fragmentation
  1647.      mechanism.
  1648.  
  1649.  
  1650.      6.2.8  Time to Live
  1651.  
  1652.           abbrev : TTL        field size : 8 bits
  1653.           units : seconds     range : 0 - 255(=4.25 mins) default : 15
  1654.  
  1655.      This field indicates the maximum time the datagram is allowed  to
  1656.      remain  in  the  internet.   If  the value of this field drops to
  1657.      zero, the datagram should be destroyed.  Section 6.1.4  describes
  1658.      the time-to-live mechanism.
  1659.  
  1660.  
  1661.      6.2.9  Protocol
  1662.  
  1663.           abbrev : PROT       field size : 8 bits
  1664.  
  1665.      This field indicates which ULP is to receive the data portion  of
  1666.      the  datagram.  The numbers assigned to common ULPs are specified
  1667.      in [13].
  1668.  
  1669.  
  1670.  
  1671.                                         System Development Corporation
  1672.      1 June 1981                   -29-                        IEN 186
  1673.  
  1674.  
  1675.      6.2.10  Header Checksum
  1676.  
  1677.           abbrev :  -         field size : 16 bits
  1678.  
  1679.      This field contains the checksum covering  the  IP  header.   The
  1680.      checksum mechanism is described in section 6.1.3.
  1681.  
  1682.  
  1683.      6.2.11  Source Address
  1684.  
  1685.           abbrev : source     field size : 32 bits
  1686.  
  1687.      This field contains the internet address of the datagram's source
  1688.      host.   The  first octet is the Source Network, and the following
  1689.      three  octets  are  the  Source  Subnetwork  Address.    Internet
  1690.      addressing is discussed in section 6.1.1.
  1691.  
  1692.  
  1693.      6.2.12  Destination Address
  1694.  
  1695.           abbrev : dest       field size : 32 bits
  1696.  
  1697.      This field contains the internet address of the datagram's desti-
  1698.      nation host.  The first octet is the Destination Network, and the
  1699.      following three octets are the  Destination  Subnetwork  Address.
  1700.      Internet addressing is discussed in section 6.1.1.
  1701.  
  1702.  
  1703.      6.2.13  Padding
  1704.  
  1705.           abbrev : -          field size : variable (8 to 24 bits)
  1706.  
  1707.      The IP header padding is used to ensure that the IP  header  ends
  1708.      on a 32-bit boundary.  The padding field is set to zero.
  1709.  
  1710.  
  1711.      6.2.14  Options
  1712.  
  1713.           abbrev :  -         field size : variable
  1714.  
  1715.      The option field is variable in length depending  on  the  number
  1716.      and  type  of  options associated with the datagram.  The options
  1717.      mechanisms are discussed in sections 6.1.1 and 6.1.6.
  1718.  
  1719.      Options may have two possible formats:
  1720.  
  1721.       a.  a single octet of option-type, or
  1722.  
  1723.       b.  a variable length string containing:
  1724.  
  1725.            1.  an option-type octet,
  1726.  
  1727.  
  1728.  
  1729.                                         System Development Corporation
  1730.      1 June 1981                   -30-                        IEN 186
  1731.  
  1732.  
  1733.            2.  an option-length octet - counting the option-type octet
  1734.                and  option-length  octet  as  well  as the option-data
  1735.                octets, and
  1736.  
  1737.            3.  the actual option-data octets.
  1738.  
  1739.  
  1740.      The option-type octet is viewed as having 3 fields:
  1741.  
  1742.               0   1  2  3  4  5  6  7
  1743.              +--+--+--+--+--+--+--+--+
  1744.              |CF|CLASS|   NUMBER     |
  1745.              +--+--+--+--+--+--+--+--+
  1746.  
  1747.           bit  0   - copy flag, if set the option is copied into
  1748.                        every fragment if fragmentation occurs.
  1749.           bits 1-2 - option class
  1750.           bits 3-7 - option number
  1751.  
  1752.      The option classes are:
  1753.  
  1754.           0 = control
  1755.           1 = internet error
  1756.           2 = debugging and measurement
  1757.           3 = reserved for future use
  1758.  
  1759.  
  1760.      The following internet options are defined:
  1761.  
  1762.       COPY CLASS NUMBER LENGTH DESCRIPTION
  1763.       ---- ----- ------ ------ -----------
  1764.        0     0     0      -    End of Option list:  This option occupies
  1765.                                only 1 octet; it has no length octet.
  1766.        0     0     1      -    No Operation:  This option occupies only 1
  1767.                                octet; it has no length octet.
  1768.        1     0     2      4    Security:  Used to carry Security, and user
  1769.                                group (TCC) information compatible with DOD
  1770.                                requirements.
  1771.        1     0     3     var.  Source Routing:  Used to route the datagram
  1772.                                based on information supplied by the source.
  1773.        0     0     7     var.  Return Route:  Used to record the route a
  1774.                                datagram takes.
  1775.        1     0     8      4    Stream ID:  Used to carry the stream
  1776.                                identifier.
  1777.        0     2     4      6    Internet Timestamp.
  1778.        0     2     5      6    Satellite Timestamp.
  1779.  
  1780.  
  1781.  
  1782.                                         System Development Corporation
  1783.      1 June 1981                   -31-                        IEN 186
  1784.  
  1785.  
  1786.      6.2.15  Specific Option Definitions
  1787.  
  1788.      Each option format is defined below.  "Option type" indicates the
  1789.      value  of the option-type octet, and "length" indicates the value
  1790.      of the length-octet if appropriate.
  1791.  
  1792.      6.2.15.1  End of Option List
  1793.  
  1794.           option type : 0     option length : N/A
  1795.  
  1796.      This one octet option marks the end of the option  list  when  it
  1797.      does  not  coincide with the four-octet boundary indicated by the
  1798.      IP header length.  This field is used at the end of all  options,
  1799.      not  the  end of each option, and need only be used if the end of
  1800.      the options would not otherwise coincide with the end of  the  IP
  1801.      header.  This option may be introduced or deleted upon fragmenta-
  1802.      tion as needed.
  1803.  
  1804.  
  1805.      6.2.15.2  No Operation
  1806.  
  1807.           option type : 1     option length : N/A
  1808.  
  1809.      This option may be used between options, for  example,  to  align
  1810.      the  beginning of a subsequent option on a 32 bit boundary.  This
  1811.      option may be introduced or deleted upon fragmentation as needed.
  1812.  
  1813.  
  1814.      6.2.15.3  Security
  1815.  
  1816.           option type : 130   option length : 4
  1817.  
  1818.      This option provides a way for hosts to  send  security  and  TCC
  1819.      (closed user groups) parameters through subnetworks in a standard
  1820.      manner.  The format for this option is as follows:
  1821.  
  1822.  
  1823.  
  1824.                                         System Development Corporation
  1825.      1 June 1981                   -32-                        IEN 186
  1826.  
  1827.  
  1828.            0          1          2          3
  1829.            01234567 89012345 67890123 45678901
  1830.           +--------+--------+--------+--------+
  1831.           |Opt.Type| Length |xxxxxxSS|  TCC   |
  1832.           +--------+--------+--------+--------+
  1833.  
  1834.               bits 0-7   : Option Type - described above
  1835.               bits 8-15  : Length - described above
  1836.               bits 16-21 : Not Used - must be zero
  1837.               bits 22-23 : SS - security, specifies security level:
  1838.                                    11-top secret
  1839.                                    10-secret
  1840.                                    01-confidential
  1841.                                    00-unclassified
  1842.  
  1843.               bits 24-31 : TCC - transmission control code, provides
  1844.                                  a means to compartmentalize traffic
  1845.                                  and define controlled communities
  1846.                                  of interest among subscribers.
  1847.  
  1848.      (This format is subject to change according to DOD requirements.)
  1849.  
  1850.      6.2.15.4  Source Route
  1851.  
  1852.           option type : 131   option length : variable
  1853.  
  1854.      The source route option provides a means for the source ULP of  a
  1855.      datagram  to  supply routing information to be used by IP modules
  1856.      along the gateway route.
  1857.  
  1858.      The option begins with the option type code.  The second octet is
  1859.      the  option  length  which  includes  the  option type octet, the
  1860.      length octet, and the source route list.  A source route list  is
  1861.      composed  of  one  or  more  internet  addresses.   Each internet
  1862.      address is 4 octets long.  When the source route list  is  empty,
  1863.      the option is removed from the datagram and the remaining routing
  1864.      is based on the destination  address  field.   The  source  route
  1865.      option is described in section 6.1.1.
  1866.  
  1867.  
  1868.      6.2.15.5  Return Route
  1869.  
  1870.           option type : 7     option length : variable
  1871.  
  1872.      The return route option provides a way  to  record  a  datagram's
  1873.      route.
  1874.  
  1875.      The option begins with the option type code.  The second octet is
  1876.      the option length which includes the option type code, the length
  1877.      octet, and the return route list.  A return route  list  is  com-
  1878.      posed of a series of internet addresses.  The return route option
  1879.      is described in section 6.1.1.
  1880.  
  1881.  
  1882.  
  1883.                                         System Development Corporation
  1884.      1 June 1981                   -33-                        IEN 186
  1885.  
  1886.  
  1887.      6.2.15.6  Stream Identifier
  1888.  
  1889.           option type : 136   option length : 4
  1890.  
  1891.      This option provides a way for 16-bit  stream  identifier  to  be
  1892.      carried  through  the  internet for use by subnetworks supporting
  1893.      the stream concept such as the SATNET.
  1894.  
  1895.  
  1896.  
  1897.      6.2.15.7  Internet Timestamp
  1898.  
  1899.           option type : 68    option length : 10
  1900.  
  1901.      The internet address of the "stamper" is  followed  by  a  32-bit
  1902.      time  measured  in milliseconds.  Time zero is defined as January
  1903.      1, 1980, GMT modulo 2^32 (=49.71 days).
  1904.  
  1905.  
  1906.  
  1907.      6.2.15.8  Satellite Timestamp
  1908.  
  1909.           option type : 69         option length : 10
  1910.  
  1911.      The internet address of the "stamper" is  followed  by  a  32-bit
  1912.      time  measured  in milliseconds.  Time zero is defined as January
  1913.      1, 1980, GMT modulo 2^32 (=49.71 days).
  1914.  
  1915.  
  1916.      6.2.16  Error Report Datagrams
  1917.  
  1918.      An error report datagram informs source IPs of erroneous or  dis-
  1919.      carded  datagrams.  Such a datagram is identified by its protocol
  1920.      field being equal to the GGP  identifier[13].   An  error  report
  1921.      datagram  is  made  up  of a minimal IP header and a data portion
  1922.      carrying error information.  The first octet of the data  portion
  1923.      contains  the  error  type octet.  The next two octets hold addi-
  1924.      tional error information which depends on the  error  type.   The
  1925.      fourth  octet  is  not used.  Beginning with the fifth octet, the
  1926.      erroneous datagram's header and first 64 data octets may appear.
  1927.  
  1928.  
  1929.  
  1930.                                         System Development Corporation
  1931.      1 June 1981                   -34-                        IEN 186
  1932.  
  1933.  
  1934.  
  1935.          0                   1                   2                   3
  1936.          0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  1937.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1938.         |   Type      |     Code        |               |   Not Used    |
  1939.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1940.         |                                                               |
  1941.         \ Header + 64 data octets from erroneous or discarded datagram  \
  1942.         \                                                               \
  1943.         |                                                               |
  1944.         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  1945.  
  1946.                          Error Datagram Data Portion
  1947.  
  1948.  
  1949.      The error types and related error information are defined below:
  1950.  
  1951.           Type   Code   Description
  1952.           ----   ----   ----------
  1953.            3      0     Destination Unreachable due to unreachable subnetwork.
  1954.            3      1     Dest. Unreachable due to unreachable host.
  1955.            3      2     Dest. Unreachable due to unreachable or unknown
  1956.                            protocol.
  1957.            3      3     Dest. Unreachable due to unreachable or inactive port.
  1958.            3      5     Dest. Unreachable due to fragmentation needed but
  1959.                            prohibited by don't fragment flag.
  1960.            11     0     Time Exceeded in transit.
  1961.            11     1     Time Exceeded during reassembly.
  1962.            12     0     Parameter Problem due to incorrect or unsupported
  1963.                            option.
  1964.             4     -     Source Quench due to congestion and discarded datagram
  1965.                            in a gateway.
  1966.             5     -     Redirect due to more direct path via alternate gateway.
  1967.                            Octets 4-7 carry the address of the alternate
  1968.                            gateway.  The redirected datagram follows at octet 8.
  1969.             8     -     Echo used to establish internet topology. No
  1970.                            erroneous datagram carried in data portion.
  1971.             0     -     Echo Reply responds to previous echo. No erroneous
  1972.                            datagram carried in data portion.
  1973.  
  1974.  
  1975.  
  1976.                                         System Development Corporation
  1977.      1 June 1981                   -35-                        IEN 186
  1978.  
  1979.  
  1980.      6.3  Extended State Machine Representation
  1981.  
  1982.      The IP protocol mechanism is defined by a state machine represen-
  1983.      tation  made up of a set of states,  a set of transitions between
  1984.      states, and a set of input events causing the state  transitions.
  1985.      In  addition,  a  state machine has an initial state whose values
  1986.      are assumed at state machine instantiation.
  1987.  
  1988.      6.3.1  State Machine Identification
  1989.  
  1990.      Each datagram is  an  independent  unit.   Therefore,  one  state
  1991.      machine  instance  exists  for  each  datagram.  Each datagram is
  1992.      uniquely named by the four values:
  1993.  
  1994.         o+ source address
  1995.  
  1996.         o+ destination address
  1997.  
  1998.         o+ protocol
  1999.  
  2000.         o+ identification
  2001.  
  2002.      6.3.2  State Machine Diagram
  2003.  
  2004.      The following diagram depicts a simplified IP state machine.
  2005.  
  2006.  
  2007.  
  2008.                                         System Development Corporation
  2009.      1 June 1981                   -36-                        IEN 186
  2010.  
  2011.  
  2012.  
  2013.  
  2014.                           send or receive a complete datagram
  2015.                                   __
  2016.                                  |  |
  2017.                                  |  v
  2018.                       *  *  *  *  *  *
  2019.                     *                  *
  2020.                    *      INACTIVE      *
  2021.                     *                  *
  2022.                       *  *  *  *  *  *
  2023.                        |           ^
  2024.               receive  |           |receive complete datagram,
  2025.                fragment|           | or final fragment,
  2026.                        |           |  or reassembly timeout
  2027.                        v           |
  2028.                       *  *  *  *  *  *
  2029.                     *                  *
  2030.                    *    REASSEMBLING    *
  2031.                     *                  *
  2032.                       *  *  *  *  *  *
  2033.                      |  ^
  2034.                      |__|
  2035.                receive
  2036.                fragments
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.      6.3.3  State Vector
  2043.  
  2044.      A state vector consists of the following elements :
  2045.  
  2046.         o+ STATE NAME = (inactive, reassembling)
  2047.  
  2048.         o+ REASSEMBLY  RESOURCES  =  control  information  and  storage
  2049.           needed  to  reassemble fragments into the original datagram,
  2050.           including:
  2051.  
  2052.              - reassembly map : a representation of each 8-octet  unit
  2053.                of  data  and its relative location within the original
  2054.                datagram.
  2055.  
  2056.              - timer : value of the reassembly timer in  unit  seconds
  2057.                ranging from 0 to 255.
  2058.  
  2059.              - total data  length  :  size  of  the  data  carried  in
  2060.                datagram being reassembled.
  2061.  
  2062.              - header : storage area for the  header  portion  of  the
  2063.                datagram being reassembled.
  2064.  
  2065.  
  2066.  
  2067.                                         System Development Corporation
  2068.      1 June 1981                   -37-                        IEN 186
  2069.  
  2070.  
  2071.              - data :  storage  area  for  the  data  portion  of  the
  2072.                datagram being reassembled.
  2073.      A state machine's initial state is inactive with unused  reassem-
  2074.      bly resources.
  2075.  
  2076.  
  2077.      6.3.4  State Machine Data Structures
  2078.  
  2079.      The IP state machine references certain data areas  corresponding
  2080.      to  the  state  vector,  and  each  interaction primitive : SEND,
  2081.      DELIVER, SNP_SEND, and SNP_DELIVER.  For clarity  in  the  events
  2082.      and  actions  section,  data  structures  are declared in Ada for
  2083.      these data areas.  However, a data  structure  may  be  partially
  2084.      typed  or completely untyped where specific formats or data types
  2085.      are implementation dependent.
  2086.  
  2087.      6.3.4.1  state_vector
  2088.  
  2089.      The definition of an IP state vector appears section 6.3.1 above.
  2090.      A state_vector structure is declared as:
  2091.  
  2092.           type state_vector_type is
  2093.             record
  2094.               state_name : (INACTIVE, REASSEMBLING);
  2095.               reassembly_map
  2096.               timer
  2097.               total_data_length
  2098.               header
  2099.               data
  2100.             end record;
  2101.  
  2102.  
  2103.      6.3.4.2  from_ULP
  2104.  
  2105.      The from_ULP structure holds the interface  parameters  and  data
  2106.      associated  with  the  SEND  primitive,  as  specified in section
  2107.      3.1.1.  The from_ULP structure is declared as:
  2108.  
  2109.           type from_ULP_type is
  2110.             record
  2111.               source_addr
  2112.               destination_addr
  2113.               protocol
  2114.               type_of_service
  2115.               identifier
  2116.               time_to_live
  2117.               dont_fragment
  2118.               length
  2119.               data
  2120.               options
  2121.             end record;
  2122.  
  2123.  
  2124.  
  2125.                                         System Development Corporation
  2126.      1 June 1981                   -38-                        IEN 186
  2127.  
  2128.  
  2129.      6.3.4.3  to_ULP
  2130.  
  2131.      The to_ULP structure holds interface parameters and data  associ-
  2132.      ated  with  the DELIVER primitive, as specified in section 3.1.2.
  2133.      The to_ULP structure is declared as:
  2134.  
  2135.           type to_ULP_type is
  2136.             record
  2137.               source_addr
  2138.               destination_addr
  2139.               protocol
  2140.               type_of_service
  2141.               length
  2142.               data
  2143.               options
  2144.               error
  2145.             end record;
  2146.  
  2147.  
  2148.      6.3.4.4  from_SNP
  2149.  
  2150.      The  from_SNP  structure  holds  the  interface  parameters   and
  2151.      datagram  associated with the SNP_DELIVER primitive, as specified
  2152.      in section 5.2.2.  The from_SNP structure is declared as:
  2153.  
  2154.           type from_SNP_type is
  2155.             record
  2156.                local_destination_addr
  2157.                dtgm: datagram_type;
  2158.                error
  2159.             end record;
  2160.  
  2161.      The dtgm element is itself a structure as specified below.
  2162.  
  2163.      6.3.4.5  to_SNP
  2164.  
  2165.      The to_SNP structure holds the  data  and  parameters  associated
  2166.      with  the  SNP_SEND  primitive  specified  in section 5.2.1.  The
  2167.      to_SNP structure is declared as:
  2168.  
  2169.           type to_SNP_type is
  2170.             record
  2171.               local_destination_addr
  2172.               type_of_service_indicators
  2173.               length
  2174.               dtgm: datagram_type;
  2175.             end record;
  2176.  
  2177.      The dtgm element  is  itself  a  structure  as  specified  below.
  2178.      specified below.
  2179.  
  2180.  
  2181.  
  2182.                                         System Development Corporation
  2183.      1 June 1981                   -39-                        IEN 186
  2184.  
  2185.  
  2186.      6.3.4.6  dtgm
  2187.  
  2188.      A dtgm structure holds a datagram made up of a header portion and
  2189.      a  data portion as specified in section 6.2.  A dtgm structure is
  2190.      declared as:
  2191.  
  2192.           type datagram_type is
  2193.              record
  2194.                version : HALF_OCTET;
  2195.                header_length : HALF_OCTET;
  2196.                type_of_service : OCTET;
  2197.                total_length : TWO_OCTETS;
  2198.                identification : TWO_OCTETS;
  2199.                dont_frag_flag : BOOLEAN;
  2200.                more_frag_flag : BOOLEAN;
  2201.                fragment_offset : ONE_N_FIVE_EIGHTHS_OCTETS;
  2202.                time_to_live : OCTET;
  2203.                protocol : OCTET;
  2204.                header_checksum : TWO_OCTETS;
  2205.                source_addr : FOUR_OCTETS;
  2206.                destination_addr : FOUR_OCTETS;
  2207.                options : option_type;
  2208.                data : array(1..DATA_LENGTH) of INTEGER;
  2209.             end record;
  2210.  
  2211.           subtype HALF_OCTET is INTEGER range 0..15;
  2212.           subtype OCTET is INTEGER range 0..255;
  2213.           subtype ONE_N_FIVE_EIGHTHS_OCTETS is INTEGER range 0..8191;
  2214.           subtype TWO_OCTETS is INTEGER range 0..65535;
  2215.           subtype FOUR_OCTETS is INTEGER range 0..4294967296;
  2216.  
  2217.  
  2218.      6.3.5  Event List
  2219.  
  2220.      The following list defines the set of possible events  in  an  IP
  2221.      state machine:
  2222.  
  2223.       a.  SEND from ULP - A ULP passes interface parameters  and  data
  2224.           to IP for delivery across the internet.
  2225.  
  2226.       b.  SNP_DELIVER from SNP - SNP passes to IP a datagram  received
  2227.           from subnetwork protocol.
  2228.  
  2229.       c.  TIMEOUT - The timing mechanism  provided  by  the  execution
  2230.           environment  indicates  a previously specified time interval
  2231.           has elapsed.
  2232.  
  2233.  
  2234.      6.3.6  State Machine Events and Actions
  2235.  
  2236.      This section is organized in three parts.  The  first  part  con-
  2237.      tains a decision table representation of state machine events and
  2238.  
  2239.  
  2240.  
  2241.                                         System Development Corporation
  2242.      1 June 1981                   -40-                        IEN 186
  2243.  
  2244.  
  2245.      actions.  The decision tables are organized by state; each  table
  2246.      corresponds to one event.
  2247.  
  2248.      The second part specifies the decision functions appearing at the
  2249.      top  of each column of a decision table.  These functions examine
  2250.      attributes of the event and the state vector to return a  set  of
  2251.      decision  results.   The  results  become  the  elements  of each
  2252.      column.  A "--" element represents a "don't care" condition where
  2253.      a decision result does not determine the action procedure chosen.
  2254.  
  2255.      The third section specifies action procedures  appearing  at  the
  2256.      right  of every row.  Each row of the decision table combines the
  2257.      decision  results  to  determine  appropriate  event  processing.
  2258.      These procedures specify event processing algorithms in detail.
  2259.  
  2260.      6.3.6.1  Events and Actions Decision Tables
  2261.  
  2262.      STATE = INACTIVE
  2263.      ================
  2264.  
  2265.      EVENT = SEND from ULP
  2266.  
  2267.  
  2268.      =============================
  2269.      | ULP  |where | need | can  |
  2270.      |params|  to  |  to  | frag |
  2271.      |valid |      | frag |      |
  2272.      =============================
  2273.      | NO   |  --  |  --  |  --  |error to ULP(PARAM_PROBLEM)
  2274.      ---------------------------------------------------------
  2275.      | YES  |  ULP |  --  |  --  |local delivery
  2276.      ---------------------------------------------------------
  2277.      | YES  |  IP  |  --  |  --  | **illegal
  2278.      ---------------------------------------------------------
  2279.      | YES  |REMOTE|  NO  |  --  |build&send
  2280.      ---------------------------------------------------------
  2281.      | YES  |REMOTE|  YES |  NO  |error to ULP(CAN'T FRAGMENT)
  2282.      ---------------------------------------------------------
  2283.      | YES  |REMOTE|  YES | YES  |fragment&send
  2284.      ---------------------------------------------------------
  2285.  
  2286.      Comments:
  2287.         A ULP passes data to IP for internet delivery. IP validates the
  2288.         interface parameters, determines the destination, and dispatches
  2289.         the ULP data to its destination.
  2290.  
  2291.  
  2292.  
  2293.                                         System Development Corporation
  2294.      1 June 1981                   -41-                        IEN 186
  2295.  
  2296.  
  2297.      STATE = INACTIVE
  2298.      ================
  2299.  
  2300.      EVENT = DELIVER from SNP
  2301.  
  2302.      ====================================
  2303.      |check-| SNP  | TTL  |where |  a   |
  2304.      |  sum |params|valid | to   | frag |
  2305.      |valid |valid |      |      |      |
  2306.      ====================================
  2307.      |  NO  |  --  |  --  |  --  |  --  |discard
  2308.      ------------------------------------------------------------------
  2309.      |  YES |  NO  |  --  |  --  |  --  |error to source(PARAM_PROBLEM)
  2310.      ------------------------------------------------------------------
  2311.      |  YES |  YES |  NO  |  --  |  --  |error to source(EXPIRED_TTL)
  2312.      ------------------------------------------------------------------
  2313.      |  YES |  YES |  YES | ULP  |  NO  |remote delivery
  2314.      ------------------------------------------------------------------
  2315.      |  YES |  YES |  YES | ULP  |  YES |reassemble;STATE:=REASSEMBLING
  2316.      ------------------------------------------------------------------
  2317.      |  YES |  YES |  YES |  IP  |  NO  |analyze
  2318.      ------------------------------------------------------------------
  2319.      |  YES |  YES |  YES |  IP  |  YES |reassemble;STATE:=REASSEMBLING
  2320.      ------------------------------------------------------------------
  2321.      |  YES |  YES |  YES |REMOTE|  --  |error to source(HOST_UNREACH)
  2322.      ------------------------------------------------------------------
  2323.  
  2324.      Comments:
  2325.        The SNP has delivered datagram from another IP.  IP validates the
  2326.        datagram header, and either delivers the data from a complete
  2327.        datagram to its destination within the host or begins reassembly
  2328.        for a datagram fragment.
  2329.  
  2330.  
  2331.  
  2332.                                         System Development Corporation
  2333.      1 June 1981                   -42-                        IEN 186
  2334.  
  2335.  
  2336.  
  2337.      STATE = REASSEMBLING
  2338.      ====================
  2339.  
  2340.      EVENT = DELIVER from SNP
  2341.  
  2342.      ===========================================
  2343.      |check-| SNP  | TTL  |where |  a   |reass.|
  2344.      |  sum |params|valid |  to  | frag | done |
  2345.      |valid |valid |      |      |      |      |
  2346.      ===========================================
  2347.      |  NO  |  --  |  --  |  --  |  --  |  --  |discard
  2348.      --------------------------------------------------------------------------
  2349.      |  YES |  NO  |  --  |  --  |  --  |  --  |error to source(PARAM_PROBLEM)
  2350.      --------------------------------------------------------------------------
  2351.      |  YES |  YES |  NO  |  --  |  --  |  --  |error to source(EXPIRED_TTL)
  2352.      --------------------------------------------------------------------------
  2353.      |  YES |  YES |  YES | ULP  |  NO  |  --  |remote delivery;state:=INACTIVE
  2354.      --------------------------------------------------------------------------
  2355.      |  YES |  YES |  YES | ULP  |  YES |  NO  |reassemble
  2356.      --------------------------------------------------------------------------
  2357.      |  YES |  YES |  YES | ULP  |  YES |  YES |reass delivery;state:=INACTIVE
  2358.      --------------------------------------------------------------------------
  2359.      |  YES |  YES |  YES |  IP  |  NO  |  --  |analyze;state:=INACTIVE
  2360.      --------------------------------------------------------------------------
  2361.      |  YES |  YES |  YES |  IP  |  YES |  NO  |reassemble
  2362.      --------------------------------------------------------------------------
  2363.      |  YES |  YES |  YES |  IP  |  YES |  YES |analyze;state:=INACTIVE
  2364.      --------------------------------------------------------------------------
  2365.      |  YES |  YES |  YES |REMOTE|  --  |  --  |error to source(HOST_UNREACH)
  2366.      --------------------------------------------------------------------------
  2367.  
  2368.      Comment:
  2369.        The SNP has delivered a datagram associated to an earlier received datagram
  2370.        fragment.  IP validates the header and either continues the reassembly
  2371.        process with the datagram fragment or delivers the data from the completed
  2372.        datagram to its destination within the host.
  2373.  
  2374.  
  2375.  
  2376.  
  2377.      EVENT = TIMEOUT
  2378.  
  2379.        reassembly timeout; state:=INACTIVE
  2380.        -----------------------------------
  2381.  
  2382.      Comment:
  2383.        The time-to-live period of the datagram being reassembled has elapsed.
  2384.        The incomplete datagram is discarded; the source IP is informed.
  2385.  
  2386.  
  2387.  
  2388.                                         System Development Corporation
  2389.      1 June 1981                   -43-                        IEN 186
  2390.  
  2391.  
  2392.      6.3.6.2  Decision Functions
  2393.  
  2394.      The following functions examine information contained  in  inter-
  2395.      face  parameters,  interface  data,  and the state vector to make
  2396.      decisions.  These decisions can be thought of as further  refine-
  2397.      ments  of  the  event  and/or state.  The functions return values
  2398.      represent the possible decisions.
  2399.  
  2400.  
  2401.      6.3.6.2.1  checksum valid
  2402.  
  2403.      The  checksum_valid  function  examines  an  incoming  datagram's
  2404.      header to determine whether it is free from transmission errors.
  2405.  
  2406.      The data effects of this function are:
  2407.  
  2408.         - Data examined only:
  2409.  
  2410.                from_SNP.dtgm.version              from_SNP.dtgm.fragment_offset
  2411.                from_SNP.dtgm.header_length        from_SNP.dtgm.time_to_live
  2412.                from_SNP.dtgm.type_of_service      from_SNP.dtgm.protocol
  2413.                from_SNP.dtgm.total_length         from_SNP.dtgm.source_addr
  2414.                from_SNP.dtgm.identification       from_SNP.dtgm.destination_addr
  2415.                from_SNP.dtgm.dont_frag_flag       from_SNP.dtgm.options
  2416.                from_SNP.dtgm.more_frag_flag       from_SNP.dtgm.padding
  2417.  
  2418.         - Return values:
  2419.  
  2420.                NO   -- checksum did not check indicating header fields
  2421.                          contain errors
  2422.                YES  -- checksum was consistent
  2423.  
  2424.      The algorithm:
  2425.  
  2426.         --The checksum algorithm is the 16-bit one's complement
  2427.         --of the one's complement sum of all 16-bit words in
  2428.         --the IP header.  For purposes of computing the checksum,
  2429.         --the checksum field is set to zero.
  2430.  
  2431.             --implementation dependent action
  2432.  
  2433.  
  2434.  
  2435.                                         System Development Corporation
  2436.      1 June 1981                   -44-                        IEN 186
  2437.  
  2438.  
  2439.      6.3.6.2.2  ULP_params_valid
  2440.  
  2441.      The ULP_params_valid function examines the  interface  parameters
  2442.      received  from a ULP to see if all values are within legal ranges
  2443.      and desired options are supported.
  2444.  
  2445.      The data effects of this function are:
  2446.  
  2447.         - Data examined only:
  2448.  
  2449.                from_ULP.time_to_live
  2450.                from_ULP.options
  2451.  
  2452.  
  2453.         - Return values:
  2454.  
  2455.                NO - some value is  illegal or a desired option is not supported.
  2456.  
  2457.                YES - examine values are within legal ranges and desired
  2458.                      options can be supported.
  2459.      The algorithm:
  2460.  
  2461.           if (
  2462.                --The time-to-live value must be greater than zero to
  2463.                --allow IP to transmit it at least once.
  2464.                (from_ULP.time_to_live < 0 )
  2465.  
  2466.             or --The options requested should be checked for consistency.
  2467.                --implementation dependent action
  2468.  
  2469.             or --Check other implementation dependent values.
  2470.               )
  2471.  
  2472.           then return NO
  2473.  
  2474.           else return YES;
  2475.  
  2476.           end if;
  2477.  
  2478.  
  2479.  
  2480.                                         System Development Corporation
  2481.      1 June 1981                   -45-                        IEN 186
  2482.  
  2483.  
  2484.      6.3.6.2.3  SNP_params_valid
  2485.  
  2486.      The SNP_params_valid function examines the  interface  parameters
  2487.      and  the  datagram received from the local subnetwork protocol to
  2488.      see if all values are within legal  ranges  and  no  errors  have
  2489.      occured.
  2490.  
  2491.      The data effects of this function are:
  2492.  
  2493.         - Data examined only:
  2494.  
  2495.                from_SNP.dtgm.version         from_SNP.dtgm.source_addr
  2496.                from_SNP.dtgm.header_length   from_SNP.dtgm.destination_addr
  2497.                from_SNP.dtgm.total_length    from_SNP.dtgm.options
  2498.                from_SNP.dtgm.protocol        other information/errors from SNP
  2499.  
  2500.         - Return values:
  2501.  
  2502.                NO - some value or values are illegal or an error has occured
  2503.  
  2504.                YES - examined values are within legal ranges and no
  2505.                      errors have occured
  2506.  
  2507.      The algorithm:
  2508.  
  2509.       if (  --The current IP header version number is 4.
  2510.           (from_SNP.dtgm.version /= 4)
  2511.  
  2512.             --The minimal IP header is 5 32-bit units in length.
  2513.         or (from_SNP.dtgm.header_length < 5)
  2514.  
  2515.             --The smallest legal datagram contains only a header and is
  2516.             --20 octets in length.
  2517.         or (from_SNP.dtgm.total_length < 20)
  2518.  
  2519.             --The legal protocol identifiers are provided in [13].
  2520.         or (from_SNP.dtgm.protocol is not one of the acceptable identifiers)
  2521.  
  2522.             --The legal network address mappings are provided in [12].
  2523.         or (from_SNP.dtgm.source_addr is not an acceptable address)
  2524.  
  2525.             --The legal network address mappings are provided in [12].
  2526.         or (from_SNP.dtgm.destination_addr is not an acceptable address)
  2527.            )
  2528.  
  2529.        then return NO
  2530.  
  2531.        elseif (any implementation dependent values received from the
  2532.                 SNP are illegal or indicate error conditions)
  2533.            then return NO
  2534.            else return YES;   --Otherwise, all values look good.
  2535.            endif;
  2536.  
  2537.  
  2538.  
  2539.                                         System Development Corporation
  2540.      1 June 1981                   -46-                        IEN 186
  2541.  
  2542.  
  2543.        endif;
  2544.  
  2545.  
  2546.  
  2547.                                         System Development Corporation
  2548.      1 June 1981                   -47-                        IEN 186
  2549.  
  2550.  
  2551.      6.3.6.2.4  where to
  2552.  
  2553.      The where_to function determines the destination of the  incoming
  2554.      datagram  by  examining  the address fields and options fields of
  2555.      the datagram header.
  2556.  
  2557.      The data effects of this function are:
  2558.  
  2559.         - Data examined only:
  2560.  
  2561.                from_SNP.dtgm.destination_addr
  2562.                from_SNP.dtgm.protocol
  2563.                from_SNP.dtgm.options
  2564.  
  2565.         - Return values:
  2566.  
  2567.                ULP - destination is an upper layer protocol at this location
  2568.                IP  - destination is this IP module
  2569.                REMOTE - destination is some remote location
  2570.  
  2571.      The algorithm:
  2572.  
  2573.         --The source route influences the datagram's gateway route.
  2574.  
  2575.           if ((from_SNP.dtgm.options contains the source routing option)
  2576.           then return REMOTE;
  2577.           endif;
  2578.  
  2579.         --Examine the destination address field of the datagram header.
  2580.  
  2581.           if ((from_SNP.dtgm.destination_addr /= this site's address)
  2582.           then
  2583.               --It's destined for another site.
  2584.                return REMOTE
  2585.           else
  2586.               --It's destined for this site.
  2587.                if (from_SNP.dtgm.protocol = the IP identifier)
  2588.                then return IP
  2589.                else
  2590.                    --Verify existence of addressed ULP at this location.
  2591.                     if (from_SNP.dtgm.protocol exists here)
  2592.                     then return ULP
  2593.                     end if;
  2594.                end if;
  2595.           end if;
  2596.  
  2597.  
  2598.  
  2599.                                         System Development Corporation
  2600.      1 June 1981                   -48-                        IEN 186
  2601.  
  2602.  
  2603.      6.3.6.2.5  TTL valid
  2604.  
  2605.      The TTL_valid function examines the IP header time-to-live  field
  2606.      of  an  incoming  datagram  to determine whether the datagram has
  2607.      exceeded its allowed lifetime.
  2608.  
  2609.      The data effects of this function are:
  2610.  
  2611.         - Data examined only:
  2612.  
  2613.                from_SNP.dtgm.time_to_live
  2614.  
  2615.         - Return values:
  2616.  
  2617.                NO - the datagram has expired
  2618.                YES - the datagram has some life left in it
  2619.  
  2620.      The algorithm:
  2621.  
  2622.          --Decrement from_SNP.dtgm.time_to_live field by the maximum
  2623.          --of either the amount of time elapsed since the last IP module
  2624.          --handled this datagram (if known) or one second.
  2625.  
  2626.           if (( from_SNP.dtgm.time_to_live
  2627.                  - maximum(number of seconds elapsed since last IP, 1))
  2628.                <= 0 )
  2629.           then return NO
  2630.           else return YES;
  2631.  
  2632.  
  2633.  
  2634.                                         System Development Corporation
  2635.      1 June 1981                   -49-                        IEN 186
  2636.  
  2637.  
  2638.      6.3.6.2.6  a frag
  2639.  
  2640.      The a_frag  function  examines  certain  fields  in  an  incoming
  2641.      datagram's header to determine whether the datagram is a fragment
  2642.      of a larger datagram.
  2643.  
  2644.      The data effects of this algorithm are:
  2645.  
  2646.         - Data examined only:
  2647.  
  2648.                from_SNP.dtgm.fragment_offset
  2649.                from_SNP.dtgm.more_frag_flag
  2650.  
  2651.         - Return values:
  2652.  
  2653.                NO - the datagram has not been fragmented
  2654.                YES - the datagram is a part of a larger datagram
  2655.  
  2656.      The algorithm:
  2657.  
  2658.         if ((from_SNP.dtgm.fragment_offset = 0)     --contains the beginning
  2659.             and (from_SNP.dtgm.more_frag_flag = 0)) --and the end of the data
  2660.  
  2661.        then return NO   --therefore it is an unfragmented datagram
  2662.  
  2663.        else return YES; --otherwise it contains only a portion of the data
  2664.                         --and is a fragment.
  2665.  
  2666.  
  2667.  
  2668.                                         System Development Corporation
  2669.      1 June 1981                   -50-                        IEN 186
  2670.  
  2671.  
  2672.      6.3.6.2.7  reassembly done
  2673.  
  2674.      The reassembly_done function examines the incoming  datagram  and
  2675.      the  reassembly resources to determine whether the final fragment
  2676.      has arrived to complete the datagram being reassembled.
  2677.  
  2678.      The data effects of this function are:
  2679.           Data examined only:
  2680.  
  2681.                state_vector.reassembly_map        from_SNP.dtgm.more_frag_flag
  2682.                state_vector.total_length          from_SNP.dtgm.header_length
  2683.                from_SNP.dtgm.fragment_offset      from_SNP.dtgm.total_length
  2684.  
  2685.         - Return values:
  2686.  
  2687.                NO - more fragments are needed to complete reassembly
  2688.                YES - this is the only fragment needed to complete reassembly
  2689.  
  2690.      The algorithm:
  2691.  
  2692.        --The total data length of the original datagram, as computed from
  2693.        --"tail" fragment, must be known before completion is possible.
  2694.  
  2695.          if (state_vector.total_data_length = 0)
  2696.          then
  2697.            --Check incoming datagram for "tail."
  2698.  
  2699.              if (from_SNP.dtgm.more_frag_flag = FALSE)
  2700.              then
  2701.                --Compute total data length and see if data in
  2702.                --this fragment fills out reassembly map.
  2703.  
  2704.                  if (reassembly map from 0 to
  2705.                       (((from_SNP.dtgm.total_length -          --total data
  2706.                          (from_SNP.dtgm.header_length*4)+7)/8) --  length
  2707.                       +7)/8  is set )
  2708.                  then return YES;
  2709.                  end if;
  2710.              else
  2711.                --Reassembly cannot be complete if total data length unknown.
  2712.                   return NO;
  2713.              end if;
  2714.  
  2715.           else --Total data length is already known.  See if data
  2716.                --in this fragment fills out reassembly map.
  2717.  
  2718.                if ( all reassembly map from 0 to
  2719.                        (state_vector.total_data_length+7)/8 is set)
  2720.                then return YES;  --final fragment
  2721.                else return NO;   --more to come
  2722.                end if;
  2723.           end if;
  2724.  
  2725.  
  2726.  
  2727.                                         System Development Corporation
  2728.      1 June 1981                   -51-                        IEN 186
  2729.  
  2730.  
  2731.      6.3.6.2.8  need to frag
  2732.  
  2733.      The need_to_frag function examines the interface  parameters  and
  2734.      data  from a ULP to determine whether the data can be transmitted
  2735.      as a single datagram or  must  be  transmitted  as  two  or  more
  2736.      datagram fragments.
  2737.  
  2738.      The data effects of this function are:
  2739.  
  2740.         - Data examined only:
  2741.  
  2742.                from_ULP.length
  2743.                from_ULP.options
  2744.  
  2745.         - Return values:
  2746.  
  2747.                NO - one datagram is small enough for the subnetwork
  2748.                YES - datagram fragments are needed to carry the data
  2749.  
  2750.      The algorithm:
  2751.          --Compute the datagram's length based on the length of data,
  2752.          --the length of options, and the standard datagram header size.
  2753.  
  2754.           if (( from_ULP.length + (number of bytes of option data) + 20 )
  2755.                   > maximum transmission unit of the local subnetwork )
  2756.           then return YES
  2757.           else return NO;
  2758.           end if;
  2759.  
  2760.  
  2761.      6.3.6.2.9  can frag
  2762.  
  2763.      The can_frag function examines the don't  fragment  flag  of  the
  2764.      interface parameters allows fragmentation.
  2765.  
  2766.      The data effects of this function are:
  2767.  
  2768.         - Data examined only:
  2769.  
  2770.                from_ULP.dont_fragment
  2771.  
  2772.         - Return values:
  2773.  
  2774.                NO - don't fragment flag is set preventing fragmentation
  2775.                YES -don't fragment flag is NOT set to allow fragmentation
  2776.  
  2777.      The algorithm:
  2778.  
  2779.           if (from_ULP.dont_fragment = TRUE)
  2780.           then return NO
  2781.           else return YES
  2782.           end if;
  2783.  
  2784.  
  2785.  
  2786.                                         System Development Corporation
  2787.      1 June 1981                   -52-                        IEN 186
  2788.  
  2789.  
  2790.      6.3.6.3  Decision Table Actions
  2791.  
  2792.      6.3.6.3.1  compute_checksum
  2793.  
  2794.      The compute_checksum procedure calculates a checksum value for  a
  2795.      datagram  header so that transmission errors can be detected by a
  2796.      destination IP.
  2797.  
  2798.      The data effects of this procedure are:
  2799.  
  2800.         - Data examined:
  2801.                to_SNP.dtgm.version                to_SNP.dtgm.fragment_offset
  2802.                to_SNP.dtgm.header_length          to_SNP.dtgm.time_to_live
  2803.                to_SNP.dtgm.type_of_service        to_SNP.dtgm.protocol
  2804.                to_SNP.dtgm.total_length           to_SNP.dtgm.source_addr
  2805.                to_SNP.dtgm.identification         to_SNP.dtgm.destination_addr
  2806.                to_SNP.dtgm.dont_frag_flag         to_SNP.dtgm.options
  2807.                to_SNP.dtgm.more_frag_flag         to_SNP.dtgm.padding
  2808.  
  2809.  
  2810.         - Data modified:
  2811.  
  2812.                to_SNP.dtgm.checksum
  2813.  
  2814.      The procedure:
  2815.  
  2816.          --The checksum algorithm is the 16-bit one's complement of
  2817.          --the one's complement sum of all 16-bit words
  2818.          --in the IP header.  For purposes of computing the checksum,
  2819.          --the checksum field is set to zero.
  2820.  
  2821.                --implementation dependent action
  2822.  
  2823.  
  2824.  
  2825.                                         System Development Corporation
  2826.      1 June 1981                   -53-                        IEN 186
  2827.  
  2828.  
  2829.      6.3.6.3.2  reassemble
  2830.  
  2831.      The reassemble procedure reconstructs an original  datagram  from
  2832.      datagram fragments.  The data effects of this procedure are:
  2833.  
  2834.         - Data examined:
  2835.  
  2836.                from_SNP.dtgm
  2837.  
  2838.         - Data modified:
  2839.  
  2840.                state_vector.reassembly_map             state_vector.header
  2841.                state_vector.timer                      state_vector.data
  2842.                state_vector.total_data_length
  2843.  
  2844.      The procedure:
  2845.        --A local variable is introduced to make the computations more clear.
  2846.        --data_in_frag equals the number of octets of data in received fragment.
  2847.  
  2848.     data_in_frag := (from_SNP.dtgm.total_length
  2849.                        -from_SNP.dtgm.header_length*4);
  2850.        --Put data in its relative position in the data area of the state vector.
  2851.  
  2852.          state_vector.data[from_SNP.dtgm.fragment_offset*8..
  2853.                            from_SNP.dtgm.fragment_offset*8+data_in_frag] :=
  2854.                     from_SNP.dtgm.data[0..data_in_frag-1];
  2855.  
  2856.        --Fill in the corresponding entries of the reassembly map representing
  2857.        --each 8-octet unit of received data.
  2858.  
  2859.          for j in (from_SNP.dtgm.fragment_offset)..
  2860.                   (from_SNP.dtgm.fragment_offset + data_in_frag + 7)/8) loop
  2861.  
  2862.            state_vector.reassembly_map[j] := 1;
  2863.          end loop;
  2864.  
  2865.        --Compute the total datagram length from the "tail-end" fragment.
  2866.  
  2867.          if (from_SNP.dtgm.more_frag_flag = FALSE)
  2868.          then state_vector.header.total_data_length :=
  2869.                                 from_SNP.dtgm.fragment_offset*8 + data_in_frag;
  2870.          end if;
  2871.  
  2872.        --Record the header of the "head-end" fragment.
  2873.  
  2874.          if (from_SNP.dtgm.fragment_offset = 0)
  2875.          then state_vector.header := from_SNP.dtgm;
  2876.          end if;
  2877.  
  2878.        --Reset the reassembly timer if its current value is less than the
  2879.        --time-to-live field of the received datagram.
  2880.  
  2881.  
  2882.  
  2883.                                         System Development Corporation
  2884.      1 June 1981                   -54-                        IEN 186
  2885.  
  2886.  
  2887.          state_vector.timer := maximum(
  2888.                           from_SNP.dtgm.time_to_live, state_vector.timer);
  2889.  
  2890.  
  2891.      A reassembly algorithm may vary according to implementation  con-
  2892.      cerns, but each one must meet these  requirements:
  2893.  
  2894.       1.  Every destination  IP  module  must  have  the  capacity  to
  2895.           receive a datagram 576 octets in length, either in one piece
  2896.           or in fragments to be reassembled.
  2897.  
  2898.       2.  The      header       of       the       fragment       with
  2899.           from_SNP.dtgm.fragment_offset   equal   to  zero  (i.e.  the
  2900.           "head-end" fragment) becomes the header of the  reassembling
  2901.           datagram.
  2902.  
  2903.       3.  The total length of the reassembling datagram is  calculated
  2904.           from the fragment with from_SNP.dtgm.more_frag_flag equal to
  2905.           zero (i.e. the "tail-end" fragment).
  2906.  
  2907.       4.  A reassembly timer is associated with  each  datagram  being
  2908.           reassembled.   The  current  recommendation  for the initial
  2909.           timer setting is 15 seconds.  Note that the choice  of  this
  2910.           parameter  value is related to the buffer capacity available
  2911.           and the data rate of the subnetwork. That is, data rate mul-
  2912.           tiplied   by   timer   value   equals   reassembly  capacity
  2913.           (e.g.10Kb/s X 15secs = 150Kb).
  2914.  
  2915.       5.  As each fragment arrives, the reassembly timer is  reset  to
  2916.           the  maximum  of state_vector.reassembly_resources.timer and
  2917.           from_SNP.dtgm.time_to_live in the incoming fragment.
  2918.  
  2919.       6.  If the reassembly timer expires, the datagram being reassem-
  2920.           bled  is  discarded.  Also, an error datagram is returned to
  2921.           the source IP to report the "time exceeded  during  reassem-
  2922.           bly" error.
  2923.  
  2924.  
  2925.  
  2926.                                         System Development Corporation
  2927.      1 June 1981                   -55-                        IEN 186
  2928.  
  2929.  
  2930.      6.3.6.3.3  build&send
  2931.  
  2932.      The build&send procedure  builds  an  outbound  datagram  in  the
  2933.      to_SNP  structure  from  the  interface  parameters  and  data in
  2934.      from_ULP and passes it to the SNP  for  transmission  across  the
  2935.      subnet.
  2936.  
  2937.      The data effects of this procedure are:
  2938.  
  2939.         - Data examined:
  2940.  
  2941.                from_ULP.source_addr               from_ULP.time_to_live
  2942.                from_ULP.destination_addr          from_ULP.dont_fragment
  2943.                from_ULP.protocol                  from_ULP.options
  2944.                from_ULP.type_of_service           from_ULP.length
  2945.                from_ULP.identifier                from_ULP.data
  2946.  
  2947.         - Data modified:
  2948.  
  2949.                to_SNP.dtgm         to_SNP.type_of_service_indicator
  2950.                to_SNP.length       to_SNP.local_destination_addr
  2951.  
  2952.      The algorithm:
  2953.  
  2954.       --Fill in each IP header field with information from from_ULP or
  2955.       --standard values.
  2956.  
  2957.           to_SNP.dtgm.version := 4;     --Current IP version is 4.
  2958.           to_SNP.dtgm.type_of_service := from_ULP.type_of_service;
  2959.       --If ID is not given by ULP, the IP must supply its own.
  2960.       to_SNP.dtgm.identification := from_ULP.identifier;
  2961.  
  2962.           to_SNP.dtgm.dont_frag_flag := from_ULP.dont_fragment;
  2963.           to_SNP.dtgm.more_frags_flag := 0;
  2964.           to_SNP.dtgm.fragment_offset := 0;
  2965.           to_SNP.dtgm.time_to_live := from_ULP.time_to_live;
  2966.           to_SNP.dtgm.protocol := from_ULP.protocol;
  2967.           to_SNP.dtgm.source_addr := from_ULP.source_address;
  2968.           to_SNP.dtgm.destination_addr := from_ULP.destination_address;
  2969.           to_SNP.dtgm.options := from_ULP.options;
  2970.           to_SNP.dtgm.padding := (as needed to end the IP header
  2971.                                    four octet boundary);
  2972.           to_SNP.dtgm.header_length := 5 + (number of bytes of option data)/4;
  2973.           to_SNP.dtgm.total_length := (to_SNP.dtgm.header_length)*4
  2974.                                                         + (from_ULP.length);
  2975.  
  2976.       --Call compute_checksum to to compute and set the checksum.
  2977.  
  2978.           compute_checksum;
  2979.  
  2980.       --And, fill in the data portion of the datagram.
  2981.  
  2982.  
  2983.  
  2984.                                         System Development Corporation
  2985.      1 June 1981                   -56-                        IEN 186
  2986.  
  2987.  
  2988.           to_SNP.dtgm.data[0..from_ULP.length -1]  := from_ULP.data[0..
  2989.                             from_ULP.length-1];
  2990.       --Set the type of service and length fields for the SNP.
  2991.  
  2992.           to_SNP.type_of_service_indicator := to_SNP.dtgm.type_of_service;
  2993.           to_SNP.length := to_SNP.dtgm.total_length;
  2994.  
  2995.       --Call the route procedure to determine a local destination
  2996.       --from the internet destination address supplied by the ULP.
  2997.  
  2998.           route;
  2999.  
  3000.       --Request the execution environment to pass the contents of to_SNP
  3001.       --to the local subnetwork protocol for transmission.
  3002.  
  3003.           TRANSFER to_SNP to the SNP.
  3004.  
  3005.      NOTE: The format of the from_ULP elements is unspecified allowing an
  3006.            implementor to assign data types for the interface parameters.
  3007.            If those data types differ from the IP header types,
  3008.            the assignment statements above become type conversions.
  3009.  
  3010.  
  3011.  
  3012.                                         System Development Corporation
  3013.      1 June 1981                   -57-                        IEN 186
  3014.  
  3015.  
  3016.      6.3.6.3.4  route
  3017.  
  3018.      The route procedure examines the destination address and  options
  3019.      fields  of  an  outbound  datagram in to_SNP to determine a local
  3020.      destination address.
  3021.  
  3022.      The data effects of this procedure are:
  3023.  
  3024.         - Data examined:
  3025.  
  3026.                to_SNP.dtgm.destination_addr
  3027.                to_SNP.dtgm.options
  3028.  
  3029.         - Data modified:
  3030.  
  3031.                to_SNP.local_destination_addr
  3032.  
  3033.      The procedure:
  3034.  
  3035.        --The source routing option influences the path of the datagram.
  3036.        --If that option is present, use the top of the source route list
  3037.        --as the destination; otherwise use the header's destination
  3038.        --address field.
  3039.  
  3040.          if (source routing present in options)
  3041.          then destination := (first address on source route list)
  3042.          else destination := to_SNP.dtgm.destination_addr;
  3043.          endif;
  3044.  
  3045.          if (the network id field of destination matches the network id
  3046.                 of the local subnet protocol )
  3047.          then
  3048.               --Translate the REST field of destination into the subnetwork
  3049.               --address of the destination on this subnet.
  3050.                  --implementation dependent action
  3051.          else
  3052.               --Find the appropriate gateway and its subnetwork address
  3053.               --based on the network id field of the destination.
  3054.                  --implementation dependent action
  3055.          end if;
  3056.  
  3057.        --Set the local destination interface parameter.
  3058.  
  3059.           to_SNP.local_destination_addr := (subnetwork address found above);
  3060.  
  3061.  
  3062.  
  3063.                                         System Development Corporation
  3064.      1 June 1981                   -58-                        IEN 186
  3065.  
  3066.  
  3067.      6.3.6.3.5  local delivery
  3068.  
  3069.      The local_delivery procedure moves the interface  parameters  and
  3070.      data  in  the  from_ULP  structure  to  the  to_ULP structure and
  3071.      delivers it to an in-host ULP.
  3072.  
  3073.      The data effects of this procedure are:
  3074.  
  3075.         - Data examined:
  3076.  
  3077.                from_ULP.destination_addr          from_ULP.length
  3078.                from_ULP.source_addr               from_ULP.data
  3079.                from_ULP.protocol                  from_ULP.options
  3080.                from_ULP.type_of_service
  3081.  
  3082.         - Data modified:
  3083.  
  3084.                to_ULP.source_addr                 to_ULP.length
  3085.                to_ULP.destination_addr            to_ULP.data
  3086.                to_ULP.protocol                    to_ULP.options
  3087.                to_ULP.type_of_service
  3088.  
  3089.      The procedure:
  3090.  
  3091.        --Move the interface parameters and data from the input
  3092.        --structure, from_ULP, directly to the output structure, to_ULP,
  3093.        --for delivery to a local ULP.
  3094.  
  3095.           from_ULP.destination_addr := to_ULP.destination_addr;
  3096.           from_ULP.source_addr      := to_ULP.source_addr;
  3097.           from_ULP.protocol         := to_ULP.protocol;
  3098.           from_ULP.type_of_service  := to_ULP.type_of_service;
  3099.           from_ULP.length           := to_ULP.length;
  3100.           from_ULP.data             := to_ULP.data;
  3101.           from_ULP.options          := to_ULP.options;
  3102.  
  3103.       --Request the execution environment to pass the contents of to_SNP
  3104.       --to the local subnet protocol for transmission.
  3105.  
  3106.           TRANSFER to_ULP to to_ULP.protocol.
  3107.  
  3108.  
  3109.  
  3110.                                         System Development Corporation
  3111.      1 June 1981                   -59-                        IEN 186
  3112.  
  3113.  
  3114.      6.3.6.3.6  remote delivery
  3115.  
  3116.      The remote_delivery procedure decomposes a datagram arriving from
  3117.      a  remote IP into interface parameters and data and delivers them
  3118.      to the destination ULP.
  3119.  
  3120.      The data effects of this procedure are:
  3121.  
  3122.         - Data examined:
  3123.  
  3124.                from_SNP.dtgm.source_addr          from_SNP.dtgm.total_length
  3125.                from_SNP.dtgm.destination_addr     from_SNP.dtgm.header_length
  3126.                from_SNP.dtgm.protocol             from_SNP.dtgm.data
  3127.                from_SNP.dtgm.type_of_service      from_SNP.dtgm.options
  3128.  
  3129.         - Data modified:
  3130.  
  3131.                to_ULP.destination_addr       to_ULP.length
  3132.                to_ULP.source_addr            to_ULP.data
  3133.                to_ULP.protocol               to_ULP.options
  3134.                to_ULP.type_of_service
  3135.  
  3136.      The algorithm:
  3137.  
  3138.           to_ULP.destination_addr  :=  from_SNP.dtgm.destination_addr;
  3139.           to_ULP.source_addr       :=  from_SNP.dtgm.source_addr;
  3140.           to_ULP.protocol          :=  from_SNP.dtgm.protocol;
  3141.           to_ULP.type_of_service   :=  from_SNP.dtgm.type_of_service;
  3142.           to_ULP.length            :=  from_SNP.dtgm.total_length -
  3143.                                           from_SNP.dtgm.header_length*4;
  3144.           to_ULP.data              :=  from_SNP.dtgm.data;
  3145.           to_ULP.options           :=  from_SNP.dtgm.options;
  3146.  
  3147.      NOTE: The format of the to_ULP elements is unspecified allowing an
  3148.            implementor to assign data types for the interface parameters.
  3149.            If those data types differ from the IP header types,
  3150.            the assignment statements above become type conversions.
  3151.  
  3152.  
  3153.  
  3154.                                         System Development Corporation
  3155.      1 June 1981                   -60-                        IEN 186
  3156.  
  3157.  
  3158.      6.3.6.3.7  reassembled delivery
  3159.  
  3160.      The reassembled_delivery procedure decomposes the  datagram  that
  3161.      has  been  reassembled in the state vector into interface parame-
  3162.      ters and data, then delivers them to a ULP.
  3163.  
  3164.      The data effects of this procedure are:
  3165.  
  3166.         - Data examined:
  3167.  
  3168.                state_vector.header.destination_addr
  3169.                state_vector.header.source_addr
  3170.                state_vector.header.protocol
  3171.                state_vector.header.type_of_service
  3172.                state_vector.header.header_length
  3173.                state_vector.header.total_length
  3174.                state_vector.header.options
  3175.                state_vector.data
  3176.  
  3177.         - Data modified:
  3178.  
  3179.                to_ULP.destination_addr       to_ULP.length
  3180.                to_ULP.source_addr            to_ULP.data
  3181.                to_ULP.protocol               to_ULP.options
  3182.                to_ULP.type_of_service
  3183.  
  3184.      The procedure:
  3185.  
  3186.           to_ULP.destination_addr  := state_vector.header.destination_addr;
  3187.           to_ULP.source_addr       := state_vector.header.source_addr;
  3188.           to_ULP.protocol          := state_vector.header.protocol;
  3189.           to_ULP.type_of_service   := state_vector.header.type_of_service;
  3190.           to_ULP.length            := state_vector.header.total_length;
  3191.                                        - state_vector.header.header_length*4;
  3192.           to_ULP.options           := state_vector.header.options;
  3193.           to_ULP.data              := state_vector.data;
  3194.  
  3195.  
  3196.  
  3197.                                         System Development Corporation
  3198.      1 June 1981                   -61-                        IEN 186
  3199.  
  3200.  
  3201.      6.3.6.3.8  fragment&send
  3202.  
  3203.      The fragment&send procedure breaks data that is  too  big  to  be
  3204.      transmitted  through  the  subnetwork  as  a single datagram into
  3205.      smaller pieces for transmission in several datagrams.
  3206.  
  3207.      The data effects of the procedure are:
  3208.  
  3209.         - Data examined only:
  3210.  
  3211.                from_ULP.source_addr               from_ULP.length
  3212.                from_ULP.destination_addr          from_ULP.data
  3213.                from_ULP.protocol                  from_ULP.options
  3214.                from_ULP.type_of_service
  3215.  
  3216.         - Data modified:
  3217.  
  3218.                to_SNP.dtgm         to_SNP.type_of_service_indicators
  3219.                to_SNP.length       to_SNP.local_destination_address
  3220.  
  3221.      Some "local variables" are used to make the procedure clearer:
  3222.  
  3223.           number_of_fragments -- number of small datagrams created from
  3224.                                  user data
  3225.  
  3226.           data_per_fragment -- the number of octets in each small datagram
  3227.  
  3228.           number_frag_blocks -- the number of 8-octet blocks in each small
  3229.                                 datagram
  3230.           data_in_last_frag -- the number of octets in the last datagram
  3231.  
  3232.      The procedure:
  3233.  
  3234.        --Compute the fragmentation variables.
  3235.  
  3236.        --The amount of data per fragment equals the max datagram size less
  3237.        --the length of the datagram header.
  3238.           data_per_fragment   := maximum subnet transmission unit
  3239.                                   - (20 + number of bytes of option data);
  3240.  
  3241.           number_frag_blocks  := data_per_fragment/8;
  3242.  
  3243.           number_of_fragments := (from_ULP.length + (data_per_fragment-1))
  3244.                                   / data_per_fragment;
  3245.  
  3246.           data_in_last_frag := from_ULP.length modulo data_per_fragment;
  3247.  
  3248.        --Create the first fragment and transmit it to the SNP.
  3249.  
  3250.           to_SNP.dtgm.version := 4;
  3251.           to_SNP.dtgm.header_length := 5 + (number bytes of option data/4);
  3252.           to_SNP.dtgm.total_length := to_SNP.dtgm.header_length
  3253.  
  3254.  
  3255.  
  3256.                                         System Development Corporation
  3257.      1 June 1981                   -62-                        IEN 186
  3258.  
  3259.  
  3260.                                                      + data_per_fragment;
  3261.           to_SNP.dtgm.identifier := from_ULP.identification;
  3262.           to_SNP.dtgm.dont_frag_flag := from_ULP.dont_fragment;
  3263.           to_SNP.dtgm.more_frag_flag := TRUE;
  3264.           to_SNP.dtgm.fragment_offset := 0;
  3265.           to_SNP.dtgm.time_to_live := from_ULP.time_to_live;
  3266.           to_SNP.dtgm.protocol := from_ULP.protocol;
  3267.           to_SNP.dtgm.source_addr := from_ULP.source_addr;
  3268.           to_SNP.dtgm.destination_addr := from_ULP.destination_addr;
  3269.           to_SNP.dtgm.options := from_ULP.options;
  3270.           to_SNP.dtgm.padding := (as needed to end header on 4-octet boundary);
  3271.  
  3272.           to_SNP.dtgm.data[0..data_per_fragment-1] :=
  3273.                                       from_ULP.data[0..data_per_fragment-1];
  3274.  
  3275.        --Set the datagram's header checksum field.
  3276.           compute_checksum;
  3277.  
  3278.        --Call route to determine the subnetwork address of the destination.
  3279.           route;
  3280.  
  3281.        --Also set the length and type of service indicators.
  3282.           to_SNP.length := to_SNP.dtgm.total_length;
  3283.           to_SNP.type_of_service_indicators := to_SNP.dtgm.type_of_service;
  3284.  
  3285.        --Request the execution environment to pass the first fragment
  3286.        --to the SNP.
  3287.           TRANSFER to_SNP to the local subnetwork protocol.
  3288.  
  3289.  
  3290.        --Format and transmit successive fragments.
  3291.  
  3292.          for j in 1..number_of_fragments-1 loop
  3293.  
  3294.             --The header fields remain the same as in the first fragment,
  3295.             --EXCEPT for:
  3296.  
  3297.               if ("copy" flag present in any options)
  3298.  
  3299.               then --put ONLY "copy" options into options fields and
  3300.                    --adjust length fields accordingly.
  3301.  
  3302.                    to_SNP.dtgm.options := (options with "copy" flag);
  3303.                    to_SNP.dtgm.header_length := 5 +
  3304.                       (number of copy options octets/4);
  3305.  
  3306.               else --only standard datagram header present
  3307.  
  3308.                    to_SNP.dtgm.header_length := 5;
  3309.  
  3310.               endif;
  3311.  
  3312.  
  3313.  
  3314.                                         System Development Corporation
  3315.      1 June 1981                   -63-                        IEN 186
  3316.  
  3317.  
  3318.            --Append data and set fragmentation fields.
  3319.  
  3320.              if (j /= number_of_fragments-1)
  3321.  
  3322.              then --middle fragment(s)
  3323.  
  3324.                to_SNP.dtgm.more_frag_flag := TRUE;
  3325.                to_SNP.dtgm.fragment_offset := j*number_frag_blocks;
  3326.                to_SNP.dtgm.total_length := to_SNP.dtgm.header_length
  3327.                                                  + data_per_fragment;
  3328.                to_SNP.dtgm.data[0..data_per_fragment-1] :=
  3329.                                      from_ULP.data[j*data_per_fragment..
  3330.                  (j*data_per_fragment + data_per_fragment-1)];
  3331.  
  3332.              else --last fragment
  3333.  
  3334.                to_SNP.dtgm.more_frag_flag := FALSE;
  3335.                to_SNP.dtgm.fragment_offset := j*number_frag_blocks;
  3336.                to_SNP.dtgm.total_length := to_SNP.dtgm.header_length*4
  3337.                                                           + data_in_last_frag;
  3338.                to_SNP.dtgm.data[0..data_in_last_frag-1] :=
  3339.                  from_ULP[j*data_per_fragment..
  3340.                  (j*data_per_fragment+ data_in_last_frag-1)];
  3341.              end if;
  3342.  
  3343.           --Call checksum to set the datagram's header checksum field.
  3344.              checksum;
  3345.  
  3346.           --Call route to determine the subnetwork address of the destination.
  3347.              route;
  3348.  
  3349.           --Also set the length and type of service indicators.
  3350.              to_SNP.length := to_SNP.dtgm.total_length;
  3351.              to_SNP.type_of_service_indicators := to_SNP.dtgm.type_of_service;
  3352.  
  3353.           --Request the execution environment to pass this fragment
  3354.           --to the SNP.
  3355.              TRANSFER to_SNP to the local subnetwork protocol.
  3356.  
  3357.        end loop;
  3358.  
  3359.  
  3360.      A fragmentation algorithm may vary  according  to  implementation
  3361.      concerns  but  every  algorithm  must meet the following require-
  3362.      ments:
  3363.  
  3364.       1.  A datagram must not be fragmented if dtgm.dont_frag_flag  is
  3365.           true.
  3366.  
  3367.       2.  Data must be broken on 8-octet boundaries.
  3368.  
  3369.  
  3370.  
  3371.                                         System Development Corporation
  3372.      1 June 1981                   -64-                        IEN 186
  3373.  
  3374.  
  3375.       3.  The minimum fragment size is 68 octets.
  3376.  
  3377.       4.  The first fragment must contain all options carried  by  the
  3378.           original datagram, except padding and no-op octets.
  3379.  
  3380.       5.  The security,  source  routing,  and  stream  identification
  3381.           options  (i.e.  marked  with "copy" flag) must be carried by
  3382.           all fragments, if present in the original datagram.
  3383.  
  3384.       6.  The first fragment must have to_SNP.dtgm.fragment_offset set
  3385.           to zero.
  3386.  
  3387.       7.  All    fragments,    except    the    last,    must     have
  3388.           to_SNP.dtgm.more_frag_flag set true.
  3389.  
  3390.       8.  The last fragment must have  the  to_SNP.dtgm.more_frag_flag
  3391.           set false.
  3392.  
  3393.  
  3394.  
  3395.                                         System Development Corporation
  3396.      1 June 1981                   -65-                        IEN 186
  3397.  
  3398.  
  3399.      6.3.6.3.9  analyze
  3400.  
  3401.      The analyze procedure examines datagrams addressed to IP contain-
  3402.      ing  error reports from other IP modules.  In general, error han-
  3403.      dling is implementation dependent.  However, guidelines are  pro-
  3404.      vided  to  identify  classes  of  errors  and suggest appropriate
  3405.      actions.  The errors and error formats  are  defined  in  section
  3406.      6.2.15.
  3407.  
  3408.      The data effects of this procedure are:
  3409.  
  3410.         - Data examined:
  3411.  
  3412.                from_SNP.dtgm.protocol
  3413.                from_SNP.data
  3414.  
  3415.         - Data modified:
  3416.  
  3417.                implementation dependent
  3418.  
  3419.      For simplicity, it is assumed that the data area can be  accessed
  3420.      as a byte array.
  3421.  
  3422.      The algorithm:
  3423.  
  3424.        --Examine the first and second octets in the data portion
  3425.        --of the error datagram to identify the error reported.
  3426.  
  3427.           case from_SNP.dtgm[1] of
  3428.  
  3429.                when 3 =>  --Destination Unreachable Message
  3430.  
  3431.                  --The errors in the "unreachable" class should
  3432.                  --should be passed to the ULP indicating data delivery
  3433.                  --to the destination is unlikely if not impossible.
  3434.  
  3435.                   case from_SNP.dtgm[2] of
  3436.  
  3437.                     when 0 =>  --net unreachable
  3438.  
  3439.                     when 1 =>  --host unreachable
  3440.  
  3441.                     when 2 =>  --protocol unreachable
  3442.  
  3443.                     when 3 =>  --port unreachable
  3444.  
  3445.                     when 5 =>  --fragmentation needed and don't fragment
  3446.                                --flag set
  3447.                   end case;
  3448.  
  3449.  
  3450.                when 11 =>  --Time Exceeded Message
  3451.  
  3452.  
  3453.  
  3454.                                         System Development Corporation
  3455.      1 June 1981                   -66-                        IEN 186
  3456.  
  3457.  
  3458.         --The "time-out" class of errors are usually not passed to the
  3459.         --ULP but should be recorded for network monitoring uses.
  3460.  
  3461.                   case from_SNP.dtgm[2] of
  3462.  
  3463.                     when 0 =>  --Time to live exceeded in transit
  3464.  
  3465.                     when 1 =>  --Fragment reassembly time exceeded
  3466.  
  3467.                   end case;
  3468.  
  3469.  
  3470.                when 12 =>  --Parameter Problem Message
  3471.                   --This error is generated by a gateway IP to indicate
  3472.                   --a problem in the options field of a datagram header.
  3473.  
  3474.                when 4  =>  --Source Quench Message
  3475.                   --This message indicates that a datagram has been
  3476.                   --discarded for congestion control.  The ULP should
  3477.                   --be informed so that traffic can be reduced.
  3478.  
  3479.                when 5  =>  --Redirect Message
  3480.                   --This message should result in a routing table update
  3481.                   --by the IP module.  It is not passed to the ULP.
  3482.  
  3483.                when 8  =>  --Echo Datagram
  3484.                   --Use of this message is implementation dependent.
  3485.  
  3486.                when 0  =>  --Echo Reply Datagram
  3487.                   --Use of this message is implementation dependent.
  3488.  
  3489.           end case;
  3490.  
  3491.  
  3492.  
  3493.                                         System Development Corporation
  3494.      1 June 1981                   -67-                        IEN 186
  3495.  
  3496.  
  3497.      6.3.6.3.10  error to ULP
  3498.  
  3499.      The error_to_ULP procedure returns an error report to a ULP which
  3500.      has  passed  invalid  parameters  or has requested a service that
  3501.      cannot be provided.
  3502.  
  3503.      The data effects of this procedure are:
  3504.  
  3505.         - Parameters:
  3506.  
  3507.               error_param : (PARAM_PROBLEM, CAN'T_FRAGMENT,
  3508.                               NET_UNREACH, HOST_UNREACH,
  3509.                               PROTOCOL_UNREACH, PORT_UNREACH);
  3510.  
  3511.         - Data examined:
  3512.  
  3513.                implementation dependent
  3514.  
  3515.         - Data modified:
  3516.  
  3517.                to_ULP.error
  3518.                implementation dependent parameters
  3519.  
  3520.  
  3521.      The algorithm:
  3522.  
  3523.         --The format of error reports to a ULP is implementation
  3524.         --dependent.  However, included in the report should be
  3525.         --a value indicating the type of error, and some information
  3526.         --to identify the associated data or datagram.
  3527.  
  3528.           to_ULP.error := error_param;
  3529.           --implementation dependent action
  3530.  
  3531.  
  3532.  
  3533.                                         System Development Corporation
  3534.      1 June 1981                   -68-                        IEN 186
  3535.  
  3536.  
  3537.      6.3.6.3.11  error to source
  3538.  
  3539.      The error_to_source procedure formats and returns an error report
  3540.      to the source of an erroneous or expired datagram.
  3541.  
  3542.      The data effects of this procedure are:
  3543.  
  3544.         - Parameters:
  3545.  
  3546.                error_param : (PARAM_PROBLEM, EXPIRED_TTL,
  3547.                               HOST_UNREACH, PROTOCOL_UNREACH);
  3548.  
  3549.         - Data examined:
  3550.  
  3551.                from_SNP.dtgm
  3552.  
  3553.         - Data modified:
  3554.  
  3555.                to_SNP.dtgm         to_SNP.local_destination_addrs
  3556.                to_SNP.length       to_SNP.type_of_service_indicators
  3557.  
  3558.      The algorithm:
  3559.  
  3560.           --Format and transmit an error datagram to the source IP.
  3561.  
  3562.           to_SNP.dtgm.version         :=  4;      --standard IP version
  3563.           to_SNP.dtgm.header_length   :=  5;      --standard header size
  3564.           to_SNP.dtgm.type_of_service :=  0;      --least quality of service
  3565.           to_SNP.dtgm.identification  :=  select new value;
  3566.           to_SNP.dtgm.more_frag_flag  :=  FALSE;
  3567.           to_SNP.dtgm.dont_frag_flag  :=  FALSE;
  3568.           to_SNP.dtgm.fragment_offset :=  0;
  3569.           to_SNP.dtgm.time_to_live    :=  60;     --or value large enough to
  3570.                                                   --allow delivery
  3571.           to_SNP.dtgm.protocol        :=  3;      --Gateway-Gateway Protocol ID
  3572.           to_SNP.dtgm.source_addr     :=  from_SNP.dtgm.destination_addr;
  3573.           to_SNP.dtgm.destination_addr := from_SNP.dtgm.source_addr;
  3574.  
  3575.         --The data section carries the error message in the first four
  3576.         --bytes, and the header and first 64 bytes of data of the
  3577.         --bad datagram.
  3578.  
  3579.           case error_param of
  3580.  
  3581.              where PARAM_PROBLEM =>
  3582.                to_SNP.dtgm.data[0] := 12;    --Gateway type = Parameter Problem
  3583.                to_SNP.dtgm.data[1] := 0;     --Code = problem with option
  3584.  
  3585.  
  3586.              where EXPIRED_TTL =>
  3587.                to_SNP.dtgm.data[0] := 11;    --Gateway type = Time Exceeded
  3588.                to_SNP.dtgm.data[1] := 0;     --Code = TTL exceed in transit
  3589.  
  3590.  
  3591.  
  3592.                                         System Development Corporation
  3593.      1 June 1981                   -69-                        IEN 186
  3594.  
  3595.  
  3596.              where HOST_UNREACH =>
  3597.                to_SNP.dtgm.data[0] := 3;    --Gateway type = Dest. Unreachable
  3598.                to_SNP.dtgm.data[1] := 1;    --Code = host unreachable
  3599.  
  3600.              where PROTOCOL_UNREACH =>
  3601.                to_SNP.dtgm.data[0] := 3;    --Gateway type = Dest. Unreachable
  3602.                to_SNP.dtgm.data[1] := 2;    --Code = protocol unreachable
  3603.  
  3604.           end case;
  3605.  
  3606.         --Below, N is assumed to be the length of the bad datagram's header
  3607.         --plus the first 64 bytes of its data section ( 84 <= N <= 124);
  3608.  
  3609.           to_SNP.dtgm.data[4..N+3] := from_SNP.dtgm[0..N-1];
  3610.           to_SNP.dtgm.total_length := to_SNP.header_length*4 + N;
  3611.  
  3612.         --Compute checksum, determine the route for the error datagram,
  3613.         --the type of service indicators, and the datagram size for the SNP.
  3614.  
  3615.           compute_checksum;
  3616.           to_SNP.type_of_service_indicators := 0;
  3617.           to_SNP.length := to_SNP.dtgm.total_length;
  3618.           route;
  3619.  
  3620.         --Request the execution environment to pass the contents of to_SNP
  3621.         --to the local subnet protocol for transmission.
  3622.  
  3623.           TRANSFER to_SNP to the SNP.
  3624.  
  3625.  
  3626.  
  3627.                                         System Development Corporation
  3628.      1 June 1981                   -70-                        IEN 186
  3629.  
  3630.  
  3631.      6.3.6.3.12  reassembly timeout
  3632.  
  3633.      The reassembly_timeout procedure generates an error  datagram  to
  3634.      the  source  IP  informing it of the datagram's expiration during
  3635.      reassembly.
  3636.  
  3637.      The data effects of the procedure are:
  3638.  
  3639.         - Data examined:
  3640.  
  3641.                state_vector.header
  3642.                state_vector.data
  3643.  
  3644.  
  3645.         - Data modified:
  3646.  
  3647.                to_SNP.dtgm
  3648.                to_SNP.length
  3649.                to_SNP.type_of_service_indicators
  3650.                to_SNP.local_destination_addrs
  3651.  
  3652.      The algorithm:
  3653.  
  3654.           --Format and transmit an error datagram to the source IP.
  3655.  
  3656.           to_SNP.dtgm.version         :=  4;       --standard IP version
  3657.           to_SNP.dtgm.header_length   :=  5;       --standard header size
  3658.           to_SNP.dtgm.type_of_service :=  0;       --least quality of service
  3659.           to_SNP.dtgm.identification  :=  new value selected;
  3660.           to_SNP.dtgm.more_frag_flag  :=  FALSE;
  3661.           to_SNP.dtgm.dont_frag_flag  :=  FALSE;
  3662.           to_SNP.dtgm.fragment_offset :=  0;
  3663.           to_SNP.dtgm.time_to_live    :=  60;
  3664.           to_SNP.dtgm.protocol        :=  3;      --Gateway-Gateway Protocol ID
  3665.           to_SNP.dtgm.source_addr     :=  state_vector.header.destination_addr;
  3666.           to_SNP.dtgm.destination_addr := state_vector.header.source_addr;
  3667.  
  3668.         --The data section carries the error message in the first four
  3669.         --bytes, and the header and first 64 bytes of data of the
  3670.         --timed-out datagram.
  3671.  
  3672.           to_SNP.dtgm.data[0] := 12;    --Gateway type = Time Exceeded
  3673.           to_SNP.dtgm.data[1] := 1;     --Code = fragment reassembly timeout
  3674.  
  3675.     --Below, N is assumed to be the length of the expired datagram's header
  3676.         --plus the first 64 bytes of its data section ( 84 <= N <= 124 ).
  3677.  
  3678.           to_SNP.dtgm.data[4..N+3] := state_vector.data[0..N-1];
  3679.           to_SNP.dtgm.total_length := to_SNP.header_length*4 + N;
  3680.  
  3681.         --Compute checksum, determine the route for the error datagram,
  3682.         --the type of service indicators, and the datagram size for the SNP.
  3683.  
  3684.  
  3685.  
  3686.                                         System Development Corporation
  3687.      1 June 1981                   -71-                        IEN 186
  3688.  
  3689.  
  3690.           compute_checksum;
  3691.           to_SNP.type_of_service_indicators := 0;
  3692.           to_SNP.length := to_SNP.dtgm.total_length;
  3693.           route;
  3694.  
  3695.         --Request the execution environment to pass the contents of to_SNP
  3696.         --to the local subnet protocol for transmission.
  3697.  
  3698.           TRANSFER to_SNP to the SNP.
  3699.  
  3700.  
  3701.  
  3702.                                         System Development Corporation
  3703.      1 June 1981                   -72-                        IEN 186
  3704.  
  3705.  
  3706.      7.  EXECUTION ENVIRONMENT REQUIREMENTS
  3707.  
  3708.      This section describes the facilities required  of  an  execution
  3709.      environment for proper implementation and operation of the Inter-
  3710.      net Protocol.  Throughout this document, the environmental  model
  3711.      portrays  each  protocol  as an independent process.  Within this
  3712.      model, the execution environment  must  provide  two  facilities:
  3713.      inter-process communication and timing.
  3714.  
  3715.      7.1  Inter-process communication
  3716.  
  3717.      The execution environment must provide an inter-process  communi-
  3718.      cation  facility  to  enable  independent  processes  to exchange
  3719.      variable-length units of information, called messages.  For  IP's
  3720.      purposes,  the IPC facility is not required to preserve the order
  3721.      of messages.
  3722.  
  3723.      IP uses the IPC facility to  exchange  interface  parameters  and
  3724.      data  with  upper  layer protocols across its upper interface and
  3725.      the subnetwork protocol across the lower interface.   Sections  3
  3726.      and 5 specify these interfaces.
  3727.  
  3728.      7.2  Timing
  3729.  
  3730.      The execution environment must provide  a  timing  facility  that
  3731.      maintains  a  real-time  clock  with units no coarser than 1 mil-
  3732.      lisecond.  A process must be able to set a timer for  a  specific
  3733.      time period and be informed by the execution environment when the
  3734.      time period has elapsed.  A process must also be able to cancel a
  3735.      previously set timer.
  3736.  
  3737.      Two IP mechanisms use the timing facility.  The  internet  times-
  3738.      tamp  carries  timing  data in millisecond units.  The reassembly
  3739.      mechanism uses timers to limit the lifetime of a  datagram  being
  3740.      reassembled.   In  the  mechanism  specification this facility is
  3741.      called TIMEOUT.
  3742.  
  3743.  
  3744.  
  3745.                                         System Development Corporation
  3746.      1 June 1981                   -73-                        IEN 186
  3747.  
  3748.  
  3749.      8.  BIBLIOGRAPHY
  3750.  
  3751.       1.  "DCEC Protocols Standardization Program  Preliminary  Archi-
  3752.           tecture  Report"  TM-7038/200/00,  Contract No. DCA100-80-C-
  3753.           0044, February 1981.
  3754.  
  3755.       2.  "Protocol Specification  Guidelines",  TM-7038/204/00,  Con-
  3756.           tract No. DCA100-80-C-0044, June 1981.
  3757.  
  3758.       3.  V. Cerf and R. Kahn, "A Protocol for Packet  Network  Inter-
  3759.           connection", IEEE Transactions on Communications, May 1974.
  3760.  
  3761.       4.  J. Postel (ed.), "DoD Standard Internet  Protocol",  Defense
  3762.           Advanced  Research  Projects  Agency, Information Processing
  3763.           Techniques Office, RFC760, IEN128, January 1980.
  3764.  
  3765.       5.  J. Postel (ed.), "DoD Standard Transmission  Control  Proto-
  3766.           col", Defense Advanced Research Projects Agency, Information
  3767.           Processing Techniques Office, RFC761, IEN129, January 1980.
  3768.  
  3769.       6.  V. Cerf and P. Kirstein, "Issues in Packet-Network Intercon-
  3770.           nection",  Proceedings  of the IEEE, November 1978, pp.1386-
  3771.           1408.
  3772.  
  3773.       7.  P.T. Kelly, "Public Packet Switched Data Networks,  Interna-
  3774.           tional  Plans  and  Standards",  Proceedings  of  the  IEEE,
  3775.           November 1978, pp.1539-1549.
  3776.  
  3777.       8.  D. Boggs, J. Shoch, E.  Taft,  and  R.  Metcalfe,  "Pup:  An
  3778.           Internetwork  Architecture", IEEE Transactions on Communica-
  3779.           tions, April 1980, pp.612-624.
  3780.  
  3781.       9.  J. Postel, "Internetwork Protocol Approaches", IEEE Transac-
  3782.           tions on Communications, April 1980, pp.604-611.
  3783.  
  3784.      10.  J. Shoch, "Inter-Network Naming, Addressing,  and  Routing",
  3785.           COMPCON, IEEE Computer Society, Fall 1978.
  3786.  
  3787.      11.  J. Shoch, "Packet Fragmentation in Inter-Network Protocols",
  3788.           Computer Networks, vol.3, no.1, February 1979.
  3789.  
  3790.      12.  J. Postel, "Address Mappings", IEN 115, USC/Information Sci-
  3791.           ences Institute, August 1979.
  3792.  
  3793.      13.  J.  Postel,  "Assigned   Numbers",   RFC   762,   IEN   127,
  3794.           USC/Information Sciences Institute, January 1980.
  3795.  
  3796.  
  3797.  
  3798.                                         System Development Corporation
  3799.      1 June 1981                   -74-                        IEN 186
  3800.  
  3801.  
  3802.      9.  GLOSSARY
  3803.  
  3804.      Destination
  3805.      An IP header field  containing  an  internet  address  indicating
  3806.      where a datagram is to be sent.
  3807.  
  3808.      datagram
  3809.      A self-contained package of data carrying enough  information  to
  3810.      be  routed from source to destination without reliance on earlier
  3811.      exchanges between source or destination and the transporting sub-
  3812.      network.
  3813.  
  3814.      datagram fragment
  3815.      The result of fragmenting a datagram, also simply referred to  as
  3816.      a  fragment.   A datagram fragment carries a portion of data from
  3817.      the larger original, and a copy of the original datagram  header.
  3818.      The  header  fragmentation  fields  are  adjusted to indicate the
  3819.      fragment's relative position within the original datagram.
  3820.  
  3821.      datagram service
  3822.      A datagram, defined above, delivered  in  such  a  way  that  the
  3823.      receiver  can  determine the boundaries of the datagram as it was
  3824.      entered by the source.  A datagram  is  delivered  with  non-zero
  3825.      probability  to  the  desired destination.  The sequence in which
  3826.      datagrams are entered into the subnetwork  by  a  source  is  not
  3827.      necessarily preserved upon delivery at the destination.
  3828.  
  3829.      DF
  3830.      Don't Fragment flag: An IP header field that when set true prohi-
  3831.      bits  an  IP  module  from  fragmenting  a datagram to accomplish
  3832.      delivery.
  3833.  
  3834.      fragmentation
  3835.      The process of breaking the data within a datagram  into  smaller
  3836.      pieces  and  attaching  new  internet  headers  to  form  smaller
  3837.      datagrams.
  3838.  
  3839.      Fragment Offset
  3840.      A field in the IP header  marking  the  relative  position  of  a
  3841.      datagram fragment within the larger original datagram.
  3842.  
  3843.      gateway
  3844.      A device, or pair of devices, which interconnect two or more sub-
  3845.      networks  enabling  the  passage  of  data from one subnetwork to
  3846.      another.  In this architecture, a gateway usually contains an  IP
  3847.      module, a Gateway-to-Gateway Protocol (GGP) module, and a subnet-
  3848.      work protocol module (SNP) for each connected subnetwork.
  3849.  
  3850.      header
  3851.      Collection of control information transmitted with  data  between
  3852.      peer entities.
  3853.  
  3854.  
  3855.  
  3856.                                         System Development Corporation
  3857.      1 June 1981                   -75-                        IEN 186
  3858.  
  3859.  
  3860.      host
  3861.      A computer which is a source or destination of messages from  the
  3862.      point of view of the communication subnetwork.
  3863.  
  3864.  
  3865.      Identification
  3866.      An IP header field used in reassembling fragments of a datagram.
  3867.  
  3868.      IHL
  3869.      Internet Header Length: an IP header field indicating the  number
  3870.      of 32-bit words making up the internet header.
  3871.  
  3872.      Internet address
  3873.      A four octet (32 bit) source or destination address composed of a
  3874.      Network  field  and  a REST field.  The latter usually contains a
  3875.      local subnetwork address.
  3876.  
  3877.      internet datagram
  3878.      The package exchanged between a pair of IP modules.  It  is  made
  3879.      up of an IP header and a data portion.
  3880.  
  3881.      local address
  3882.      The address of a host within a subnetwork.  The actual mapping of
  3883.      an internet address onto local subnetwork addresses is quite gen-
  3884.      eral, allowing for many to one mappings.
  3885.  
  3886.      local subnetwork
  3887.      The subnetwork directly attached to host or gateway.
  3888.  
  3889.      MF
  3890.      More Fragments flag: an IP  header  field  indicating  whether  a
  3891.      datagram fragment contains the end of a datagram.
  3892.  
  3893.      module
  3894.      An implementation, usually in software, of a  protocol  or  other
  3895.      procedure.
  3896.  
  3897.      MTU
  3898.      Maximum Transmission Unit: a  subnetwork  dependent  value  which
  3899.      indicates the largest datagram that a subnetwork can handle.
  3900.  
  3901.      octet
  3902.      An eight bit byte.
  3903.  
  3904.      Options
  3905.      The optional set of fields at the end of the IP  header  used  to
  3906.      carry  control  or  routing  data.   An Options field may contain
  3907.      none, one, or several options, and each  option  may  be  one  to
  3908.      several  octets  in  length.  The options allow ULPs to customize
  3909.      IP's services.  The options are also useful in testing situations
  3910.      to carry diagnostic data such as timestamps.
  3911.  
  3912.  
  3913.  
  3914.                                         System Development Corporation
  3915.      1 June 1981                   -76-                        IEN 186
  3916.  
  3917.  
  3918.      packet
  3919.      The unit of data transmitted by  a  packet-switched  network.   A
  3920.      packet  usually contains nested control information and data from
  3921.      the upper layer protocols using the subnetwork.
  3922.  
  3923.      packet network
  3924.      A network based on  packet-switching  technology.   Messages  are
  3925.      split  into small units (packets) to be routed independently on a
  3926.      store and  forward  basis.   This  packetizing  pipelines  packet
  3927.      transmission to effectively use circuit bandwidth.
  3928.  
  3929.      Padding
  3930.      An IP header field, an octet in length, inserted after  the  last
  3931.      option field to ensure that the data portion of a datagram begins
  3932.      on a 32-bit word boundary.  The Padding field value is zero.
  3933.  
  3934.      Protocol
  3935.      An internet header field used to identify the upper layer  proto-
  3936.      col  that  is the source and destination of the data within an IP
  3937.      datagram.
  3938.  
  3939.      Precedence
  3940.      One of the service quality parameters provided  by  the  type  of
  3941.      service  mechanism.  Precedence is a relative measure of datagram
  3942.      importance.  This parameter can be set to  one  of  five  levels:
  3943.      routine,  priority,  immediate,  flash,  or  flash  override.  It
  3944.      appears as a three bit field within the Type of Service field  in
  3945.      the IP header.
  3946.  
  3947.      reassembly
  3948.      The process of piecing together datagram fragments  to  reproduce
  3949.      the original large datagram. Reassembly is based on fragmentation
  3950.      data carried in their IP headers.
  3951.  
  3952.      Reliability
  3953.      One of the service quality parameters provided  by  the  type  of
  3954.      service  mechanism.   The reliability parameter can be set to one
  3955.      of four levels: lowest, lower, higher, or highest.  It appears as
  3956.      a  two  bit  field  within  the  Type  of Service field in the IP
  3957.      header.
  3958.  
  3959.      reliability
  3960.      A quality of data transmission  defined  as  guaranteed,  ordered
  3961.      delivery.
  3962.  
  3963.      Rest
  3964.      The three octet field of the internet address usually  containing
  3965.      a local address.
  3966.  
  3967.      segment
  3968.      The unit of data exchanged by TCP modules.  This term may also be
  3969.      used  to  describe  the  unit  of  exchange between any transport
  3970.  
  3971.  
  3972.  
  3973.                                         System Development Corporation
  3974.      1 June 1981                   -77-                        IEN 186
  3975.  
  3976.  
  3977.      protocol modules.
  3978.  
  3979.      Source
  3980.      An IP  header  field  containing  the  internet  address  of  the
  3981.      datagram's point of origin.
  3982.  
  3983.      stream delivery service
  3984.      The special handling required for a class  of  volatile  periodic
  3985.      traffic  typified  by  voice.   The  class  requires  the maximum
  3986.      acceptable delay to be only slightly larger than the minimum pro-
  3987.      pagation  time,  or  requires  the  allowable  variance in packet
  3988.      interarrival time to be small.
  3989.  
  3990.      SNP
  3991.      SubNetwork Protocol: the  protocol  residing  in  the  subnetwork
  3992.      layer  below  IP  which  provides data transfer through the local
  3993.      subnet.  In some systems, an  adaptor  module  must  be  inserted
  3994.      between  IP  and  the subnetwork protocol to reconcile their dis-
  3995.      similar interfaces.
  3996.  
  3997.      TCP
  3998.      Transmission Control Protocol:  a  transport  protocol  providing
  3999.      connection-oriented,  end-to-end  reliable  data  transmission in
  4000.      packet-switched computer subnetworks and internetworks.
  4001.  
  4002.      TCP segment
  4003.      The unit of data exchanged between TCP modules (including the TCP
  4004.      header).
  4005.  
  4006.      Total Length
  4007.      An IP header field containing the number of octets in an internet
  4008.      datagram, including both the IP header and the data portion.
  4009.  
  4010.      Type of Service
  4011.      An IP header field containing the  transmission  quality  parame-
  4012.      ters:  precedence level, reliability level, speed level, resource
  4013.      trade-off (precedence vs.  reliability),  and  transmission  mode
  4014.      (datagram vs. stream).  This field is used by the type of service
  4015.      mechanism which allows ULPs to select the quality of transmission
  4016.      for a datagram through the internet.
  4017.  
  4018.      ULP
  4019.      Upper Layer Protocol: any protocol above IP in the layered proto-
  4020.      col  hierarchy  that uses IP.  This term includes transport layer
  4021.      protocols, presentation layer protocols, session layer protocols,
  4022.      and application programs.
  4023.  
  4024.      user
  4025.      A generic term identifying a process or person employing a proto-
  4026.      col.   In IP's case, this term may describe a transport protocol,
  4027.      a presentation layer protocol, a session layer  protocol,  or  an
  4028.      application program.
  4029.  
  4030.  
  4031.  
  4032.                                         System Development Corporation
  4033.      1 June 1981                   -78-                        IEN 186
  4034.  
  4035.  
  4036.      Version
  4037.      An IP header field indicating the format of the IP header.
  4038.  
  4039.